Results 1 to 2 of 2

Thread: Need help understand Excel Macro

  1. #1

    Need help understand Excel Macro

    Register for a FREE account, and/
    or Log in to avoid these ads!

    I need help in understanding what this macro does...

    Sub DoGoalSeek()'
    ' DoGoalSeek Macro
    ' Macro recorded 19/04/2011 by glittle
        ActiveCell.FormulaR1C1 = "5"
        Range("E30").GoalSeek Goal:=0, ChangingCell:=Range("B4")
    End Sub
    I am novice to this. Please help me

  2. #2
    Administrator Ken Puls's Avatar
    Join Date
    Mar 2011
    Nanaimo, BC, Canada
    Blog Entries
    Excel Version
    Excel Office 365 Insider
    • It puts a 5 in cell B4
    • It recalculates the worksheet
    • It changes E30 to 0 by changing the value in B4
    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.

    Hope that helps,
    Ken Puls, FCPA, FCMA, MS MVP

    Learn to Master Your Data at the Power Query Academy (the world's most comprehensive online Power Query training), with my book M is for Data Monkey, or our new Power Query Recipe cards!

    Main Site: -||- Blog: -||- 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.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts