Goal Seek

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
 
D

David Biddulph

It may be that you can rearrange the formulae to calculate ditectly, but you
haven't told us the formulae you are using.
 
D

dimm

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
 
D

Dana DeLouis

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.
 
D

David Biddulph

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?
....
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top