+ Reply to Thread
Results 1 to 6 of 6

Goal Seek on Variable

  1. #1
    Forum Contributor
    Join Date
    08-05-2009
    Location
    Colorado Springs, CO
    MS-Off Ver
    Office 365
    Posts
    160

    Goal Seek on Variable

    When you create this macro:
    Please Login or Register  to view this content.
    This produces the compiler error "Invalid qualifier".

    So how does one use a variable to perform a goal seek, or alternatively, use the difference between two cells?

  2. #2
    Forum Expert rorya's Avatar
    Join Date
    08-13-2008
    Location
    East Sussex, UK
    MS-Off Ver
    365 Ent Monthly Channel / Insiders Beta
    Posts
    8,913

    Re: Goal Seek on Variable

    GoalSeek is a range method, so you'd need a formula cell that subtracts the other two cells.
    Rory

  3. #3
    Forum Guru Kaper's Avatar
    Join Date
    12-14-2013
    Location
    Warsaw, Poland
    MS-Off Ver
    most often: Office 365 in Windows environment
    Posts
    8,623

    Re: Goal Seek on Variable

    The goal seek works on cell values. So if you have your ABS function in cell (say) A36 then you can perform
    Please Login or Register  to view this content.
    Best Regards,

    Kaper

  4. #4
    Forum Guru
    Join Date
    04-13-2005
    Location
    North America
    MS-Off Ver
    2002/XP and 2007
    Posts
    15,829

    Re: Goal Seek on Variable

    Goal Seek is just a fairly basic implementation of a Newton-Raphson or secant type algorithm. I have example code here (https://www.excelforum.com/tips-and-...ml#post4688682 ) that shows how to code a NR type algorithm in VBA. If you really want to do it all in VBA without using range.GoalSeek, then you should be able to look at what is in C36 and D36 and figure out how to execute an NR or secant algorithm on the formula(s) in C36 and D36.
    Quote Originally Posted by shg
    Mathematics is the native language of the natural world. Just trying to become literate.

  5. #5
    Registered User
    Join Date
    08-10-2015
    Location
    N/A
    MS-Off Ver
    Microsoft Office 365 ProPlus
    Posts
    14

    Re: Goal Seek on Variable

    I have a question that might be related to this.

    I have this:
    HTML Code: 
    I'm wondering how I can set a max limit of 1.00 for PayRate?

    I found references online that gave me two options but I was unable to implement them:

    1- Set a static variable for your max value and then do an if check,

    2- Create a function called checkMaxVal(int) that returns a bool.

    Any help is appreciated!

  6. #6
    Forum Guru
    Join Date
    04-13-2005
    Location
    North America
    MS-Off Ver
    2002/XP and 2007
    Posts
    15,829

    Re: Goal Seek on Variable

    @Sam1989: This forum is pretty strict about rules like not posting your question in another users thread. We strongly prefer that you start your own thread. If you are convinced that this thread will be of use, include a link or other reference to this thread in your new thread.

+ 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. Trying to create and auto-ranging goal seek macro, with a variable user input.
    By Spreadsheet_Bomber in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 10-21-2016, 06:04 AM
  2. [SOLVED] Seeking Goal without using Goal Seek
    By Doc Science in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 01-07-2015, 02:24 PM
  3. Replies: 3
    Last Post: 07-27-2012, 01:44 PM
  4. Goal Seek VBA with relative 'Goal' parameter
    By alirulez in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 05-07-2012, 07:19 PM
  5. [SOLVED] GOAL SEEK ...more than one variable input
    By worswick25 in forum Excel General
    Replies: 2
    Last Post: 04-25-2012, 12:09 PM
  6. Goal Seek Formula But Not Using Goal Seek
    By cady923 in forum Excel General
    Replies: 1
    Last Post: 08-05-2011, 03:53 PM
  7. Goal Seek
    By fdelriog in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 12-02-2009, 12:31 PM

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