+ Reply to Thread
Results 1 to 7 of 7

Automatic Goal seek

  1. #1
    Registered User
    Join Date
    01-09-2017
    Location
    Oslo, Norway
    MS-Off Ver
    2007
    Posts
    4

    Automatic Goal seek

    Dear all,


    I would like to make a table with automatic goal seek for each line.

    I have attached the file I use and would like the following:

    When I'm changing the " wanted Margin %" column in G column I want the price in column H to change automatically.

    Can somebody help me to make a macro for the entire list so i don't need to make it for each line.

    Thank you-

    Morten
    Attached Files Attached Files

  2. #2
    Forum Moderator - RIP Richard Buttrey's Avatar
    Join Date
    01-14-2008
    Location
    Stockton Heath, Cheshire, UK
    MS-Off Ver
    Office 365, Excel for Windows 2010 & Excel for Mac
    Posts
    29,464

    Re: Automatic Goal seek

    Please clarify.

    You mention changing the Column G %. At the moment this is a formula. Do you mean you are changing one of the C and/or E cells which RESULTS in a change to G?

    If not and you are relying on the formula the take G6 as an example. This SHOWS as 100% but it's actually slightly less since it's unrounded. This means that H6 will show as 11,999,877 and not the 12,000,000 you show.

    Why not just hold the following formula in H6 copied to every cell and avoid complicating with a macro.

    Formula: copy to clipboard
    Please Login or Register  to view this content.
    Richard Buttrey

    RIP - d. 06/10/2022

    If any of the responses have helped then please consider rating them by clicking the small star icon below the post.

  3. #3
    Registered User
    Join Date
    01-09-2017
    Location
    Oslo, Norway
    MS-Off Ver
    2007
    Posts
    4

    Re: Automatic Goal seek

    Hi again,

    I have done some changes in the file so t will be easier.

    I have also managed to make a macro for so the column C will change column D. But is a easier way to write the macro so I don't need to write line by line?

    Macro7 Macro
    '

    '
    Range("D6").GoalSeek Goal:=Range("g6"), ChangingCell:=Range("E6")
    Range("D7").Select
    Range("D7").GoalSeek Goal:=Range("g7"), ChangingCell:=Range("E7")
    Range("D8").Select


    And how do I do the macro automatic, so when I change column G the column D will change right away.
    Attached Files Attached Files

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

    Re: Automatic Goal seek

    I think this problem is far easier to solve algebraically than it is to automate goal seek. If I have read the problem correctly:

    D=C/E
    C=E-B
    D=(E-B)/E
    which should be very easy to solve for E. If you need an algebra refresher: http://www.purplemath.com/modules/solvelin.htm page 3 of the tutorial shows examples of "mult-step" problems.
    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
    10-28-2008
    Location
    Turkey
    Posts
    88

    Re: Automatic Goal seek

    .

    Try this macro for part of sheet. You can do same codes a little changes to others

    Please Login or Register  to view this content.
    Also file attached below.
    Attached Files Attached Files
    Last edited by yurttas; 01-09-2017 at 11:26 AM.

  6. #6
    Registered User
    Join Date
    01-09-2017
    Location
    Oslo, Norway
    MS-Off Ver
    2007
    Posts
    4

    Re: Automatic Goal seek

    Thank you,

    But how do get column D to change automatically when I change column G?

  7. #7
    Registered User
    Join Date
    10-28-2008
    Location
    Turkey
    Posts
    88

    Re: Automatic Goal seek

    Quote Originally Posted by Storemannen View Post
    Thank you,

    But how do get column D to change automatically when I change column G?
    You should repeat macro by changing Ranges: Range("d6:d24") for every part of sheet.

+ 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. Automatic Goal seek
    By Storemannen in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 01-09-2017, 07:28 AM
  2. Automatic Goal Seek That References Cell For Target Value
    By Navigator16171 in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 10-23-2016, 05:52 AM
  3. Automatic Goal Seek and Calculate Active Sheet Code
    By grifbomber in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 06-11-2016, 10:42 AM
  4. Automatic goal seek program
    By calltobala in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 05-08-2015, 03:14 PM
  5. [SOLVED] Automatic Goal Seek
    By Talazem in forum Excel Programming / VBA / Macros
    Replies: 11
    Last Post: 10-04-2013, 11:28 AM
  6. Faster calculation for multiple automatic goal seek
    By lockd in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 08-26-2013, 09:30 AM
  7. Automatic Goal Seek VBA won't work now
    By Brodie05 in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 04-25-2013, 08:43 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