+ Reply to Thread
Results 1 to 2 of 2

Automate Goalseek using macro and vba

  1. #1
    Registered User
    Join Date
    01-10-2014
    Location
    Stuttgart, Germany
    MS-Off Ver
    Excel 2013
    Posts
    8

    Automate Goalseek using macro and vba

    Hi,

    I am trying to automate Goalseek using vba. Please see attached file.

    What I want to do is goalseek by setting cell 'E6' to values in column 'A' by changing cell 'E8'. Then write the values in 'E8' to cell in column 'B'.

    I am not sure what is wrong with the vba but it is not working.

    Thank you.
    Attached Files Attached Files

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

    Re: Automate Goalseek using macro and vba

    It looks like you need to review the syntax for VBA's For..Next statement: https://docs.microsoft.com/en-us/off...next-statement VBA's For...Next requires that you specify the counter variable once. You have:
    Please Login or Register  to view this content.
    Should be
    Please Login or Register  to view this content.
    I deleted the extra "i=" and the code seemed to run fine.
    Quote Originally Posted by shg
    Mathematics is the native language of the natural world. Just trying to become literate.

+ 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] Automate goalseek so that it runs when any cell on the sheet is changed
    By Goakseeker in forum Excel Programming / VBA / Macros
    Replies: 13
    Last Post: 08-21-2018, 04:56 PM
  2. Stop goalseek macro if value is ecxceeded
    By 95marine in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 04-26-2017, 05:15 PM
  3. Macro to peform Goalseek across range of columns
    By Matt_86 in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 12-17-2014, 11:06 AM
  4. goalseek macro rounds to two decimals. need 3!
    By thesweetp in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 12-30-2011, 02:34 PM
  5. basic excel macro (goalseek)
    By athmea in forum Excel - New Users/Basics
    Replies: 0
    Last Post: 04-03-2008, 09:59 AM
  6. [SOLVED] GoalSeek in VBA
    By [email protected] in forum Excel General
    Replies: 1
    Last Post: 07-20-2006, 12:20 AM
  7. mimic goalseek
    By Monique in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 08-25-2005, 03:05 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