I need help in understanding what this macro does...
I am novice to this. Please help meCode:Sub DoGoalSeek()' ' DoGoalSeek Macro ' Macro recorded 19/04/2011 by glittle ' ' Range("B4").Select ActiveCell.FormulaR1C1 = "5" ActiveSheet.Calculate Range("E30").Select Range("E30").GoalSeek Goal:=0, ChangingCell:=Range("B4") End Sub
Based on what I can see here, I'd assume that E30 has a formula that uses B4 as an input. Why it puts a 5 in the cell is beyond me, though, as the value will just get overwritten when the goalseek is triggered.
- It puts a 5 in cell B4
- It recalculates the worksheet
- It changes E30 to 0 by changing the value in B4
Hope that helps,
Ken Puls, FCPA, FCMA, MS MVP (Excel)
Master your data with Power Query: Purchase your copy of my book M is for Data Monkey today!
Main Site: http://www.excelguru.ca -||- Blog: http://www.excelguru.ca/blog -||- Forums: http://www.excelguru.ca/forums
Check out the Excelguru Facebook Fan Page -||- Follow Me on Twitter
If you've been given VBA code (a macro) for your solution, but don't know where to put it, CLICK HERE.