Goal Seek

  • Thread starter Thread starter Tarig
  • Start date Start date
T

Tarig

Hi,
Below is an abstract of my payroll sheet. I know how to use goal seek to
change Basic Salary so Net Salary equals Proposed Net Salary, my problem is
that I have 800 lines to change, Is there any way I can repeat goal seek
through macros or anything that can save me the hassel of doing it line by
line?

Basic Salary Allowance1 Gross salary Tax Net Salary Proposed Net
Salary
1000 200 1200 120 1,080
1,400
2000 300 2,300 270 2,030
2,500

Thanks in advance
 
It may be that you can rearrange the formulae to calculate ditectly, but you
haven't told us the formulae you are using.
 
Repeating something using a macro is relatively easy. Just use a
Do-Until-Loop statement.

However...I don't know what a goal seek is...and hence can't write up a code
snippet for you....so maybe we can help each other...:-)...whats a goal seek?

Something like this:

RowValue = 0
Do Until RowValue = 800
RowValue = RowValue + 1

[Your required code here.]

Loop
 
Here's one general outline:

Sub Demo()
Dim R As Long 'Row
For R = 1 To 10
Cells(R, 5).GoalSeek Cells(R, 6), Cells(R, 1)
Next R
End Sub

Reads: Set the cell in Column 5 to equal the value in Columns 6, by changing
the cell in Column 1.
 
Excel help will tell you about goal seek.
--
David Biddulph

dimm said:
Repeating something using a macro is relatively easy. Just use a
Do-Until-Loop statement.

However...I don't know what a goal seek is...and hence can't write up a
code
snippet for you....so maybe we can help each other...:-)...whats a goal
seek?
....
 
Back
Top