Soldato
- Joined
- 18 Oct 2012
- Posts
- 8,333
figured this might get a few heads scratching out there.
basically i have a spreadsheet with multiple sheets that are copies of each other with different calculation paremeters.
i have a cell on each sheet that needs to be manually set to obtain a known value in another cell, now excel does have this functionality in the goal seek command, but what i'd like is an automatic method to goal seek on all these sheets when other values are changed.
i've found this: http://excel.kingofmath.com/?p=267
and adjusting it to my sheet i have:
Private Sub CheckGoalSeek()
Static isWorking As Boolean
If Round(Range(“L4”).Value, 6) <> Range("L3") And Not isWorking Then
isWorking = True
Range(“B8”).Value = 0
Range(“L4”).GoalSeek Goal:=Range("L3"), ChangingCell:=Range(“B8”)
isWorking = False
End If
End Sub
where B8 is the static value to adjust, L3 is the goal value and goal output is L4
thing is, it's not triggering, and it's been a while since i've messed with macro's but it seems like it should be working even if the calculation is triggered from another sheet.
edit: so some debugging seems to suggest it thinks L4 is empty, despite L4 very definately not being empty as it contains the output formula for my calculation
basically i have a spreadsheet with multiple sheets that are copies of each other with different calculation paremeters.
i have a cell on each sheet that needs to be manually set to obtain a known value in another cell, now excel does have this functionality in the goal seek command, but what i'd like is an automatic method to goal seek on all these sheets when other values are changed.
i've found this: http://excel.kingofmath.com/?p=267
and adjusting it to my sheet i have:
Private Sub CheckGoalSeek()
Static isWorking As Boolean
If Round(Range(“L4”).Value, 6) <> Range("L3") And Not isWorking Then
isWorking = True
Range(“B8”).Value = 0
Range(“L4”).GoalSeek Goal:=Range("L3"), ChangingCell:=Range(“B8”)
isWorking = False
End If
End Sub
where B8 is the static value to adjust, L3 is the goal value and goal output is L4
thing is, it's not triggering, and it's been a while since i've messed with macro's but it seems like it should be working even if the calculation is triggered from another sheet.
edit: so some debugging seems to suggest it thinks L4 is empty, despite L4 very definately not being empty as it contains the output formula for my calculation
Last edited: