+ Reply to Thread
Results 1 to 5 of 5

Goal Seek Range Change

Hybrid View

  1. #1
    Registered User
    Join Date
    08-22-2014
    Location
    Monterrey
    MS-Off Ver
    2010
    Posts
    42

    Goal Seek Range Change

    Hello!!!

    I'm new here, and don't have experience in VBA programming. I need some help!

    In the following:

    Sub GoalSeek()
    '
    ' GoalSeek Macro
    '

    '
    Range("D7").GoalSeek Goal:=0, ChangingCell:=Range("D4")
    End Sub


    I need to change the range from a specific cell, to be the active cell. What do I need to do/change/replace in the macro above?

    Thanks!!!

  2. #2
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2003, 2010
    Posts
    40,678

    Re: Goal Seek Range Change

    Change either Range("D7") or Range("D4") to ActiveCell, depending on which you were referring to.
    Entia non sunt multiplicanda sine necessitate

  3. #3
    Registered User
    Join Date
    08-22-2014
    Location
    Monterrey
    MS-Off Ver
    2010
    Posts
    42

    Re: Goal Seek Range Change

    I know I have to change the "D7" to ActiveCell, I just don't know how to write it...

    Range("ActiveCell").GoalSeek Goal:=0, ChangingCell:=Range("D4")?

  4. #4
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2003, 2010
    Posts
    40,678

    Re: Goal Seek Range Change

    Change either Range("D7") or Range("D4") to ActiveCell, depending on which you were referring to.
    That means

    ActiveCell.GoalSeek Goal:=0, ChangingCell:=Range("D4")
    or

    Range("D7").GoalSeek Goal:=0, ChangingCell:=ActiveCell

  5. #5
    Registered User
    Join Date
    08-22-2014
    Location
    Monterrey
    MS-Off Ver
    2010
    Posts
    42

    Re: Goal Seek Range Change

    Thanks!!!!

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. [SOLVED] Goal Seek Dynamic Range
    By The Cardman in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 12-12-2012, 02:27 AM
  2. Goal Seek Dynamic Range
    By The Cardman in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 12-12-2012, 02:05 AM
  3. [SOLVED] Goal seek in VBA, but not on a range
    By Telefonica in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 09-02-2012, 06:56 PM
  4. Using Goal Seek to determine value within Range
    By Ada01 in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 02-28-2008, 11:09 AM
  5. [SOLVED] how to change values to formula in VBA to carry out goal seek?
    By Desmond in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 01-18-2006, 08:35 AM

Bookmarks

Posting Permissions

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

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1