+ Reply to Thread
Results 1 to 5 of 5

Limit the maximum value of variable related to Goal Seek Excel VBA

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

    Limit the maximum value of variable related to Goal Seek Excel VBA

    I have a question that might be interesting for others as well

    I have this:
    HTML Code:
    Range("Solve").GoalSeek Goal:=0, ChangingCell:=Range("PayRate")

    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!

  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: Limit the maximum value of variable related to Goal Seek Excel VBA

    Goal Seek doesn't support that; you would need to use Solver.
    Entia non sunt multiplicanda sine necessitate

  3. #3
    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: Limit the maximum value of variable related to Goal Seek Excel VBA

    Though you could do this:

    Please Login or Register  to view this content.

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

    Re: Limit the maximum value of variable related to Goal Seek Excel VBA

    Thanks a lot shg. This worked perfectly!

  5. #5
    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: Limit the maximum value of variable related to Goal Seek Excel VBA

    You're welcome.

+ 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. Goal Seek on Variable
    By Atom in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 01-03-2019, 12:30 PM
  2. Goal Seek related data output macro help
    By tuxmonkey in forum Excel Programming / VBA / Macros
    Replies: 11
    Last Post: 06-12-2017, 07:06 PM
  3. 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
  4. variable monthly usage with maximum limit.
    By excobra in forum Excel General
    Replies: 1
    Last Post: 05-29-2014, 06:41 AM
  5. related to Automatically Goal Seek
    By duvius in forum Excel Programming / VBA / Macros
    Replies: 9
    Last Post: 04-12-2014, 05:12 PM
  6. Replies: 3
    Last Post: 07-27-2012, 01:44 PM
  7. [SOLVED] GOAL SEEK ...more than one variable input
    By worswick25 in forum Excel General
    Replies: 2
    Last Post: 04-25-2012, 12:09 PM

Tags for this Thread

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