+ Reply to Thread
Results 1 to 3 of 3

Goalseek in VBA - Is it possible to see how many iterations were used?

  1. #1
    Registered User
    Join Date
    10-12-2014
    Location
    Germany
    MS-Off Ver
    2010
    Posts
    1

    Goalseek in VBA - Is it possible to see how many iterations were used?

    Hey there,

    i was wondering, if there is any way to see how many iterations were used when goalseek was invoked?
    I am writing some routines to solve equation systems and wanted to compare them to the goal seek method.
    Sure, i can do a comparison by calculation time, but I want to see how many iterations goal seek needed to solve the problem.
    Of course I could set max iterations to 1 and count how many times, I have to restart goal seek to come ton a solution.
    But this would be kind of messy.
    Unfourtunately, as I see it, goal seek does not return any information on iterations used.

    Looking forward to your replies,
    Best regards,
    Bel.

  2. #2
    Valued Forum Contributor fredlo2010's Avatar
    Join Date
    07-04-2012
    Location
    Miami, United States
    MS-Off Ver
    Excel 365
    Posts
    762

    Re: Goalseek in VBA - Is it possible to see how many iterations were used?

    Hi,

    I am not sure that you can get the amount of iterations from the GoalSeek. What I can tell you is that using Excel's default features in faster than building your own.

    I also noticed that there is a huge difference between the use of the GoalSeek in the Excel dialog box and using it through the VBA method; the latest is almost instantaneous.

    Here is a small experiment I designed to check the speed. Note that the one hat uses the dialogbox needs a little bit of human intervention which adds a small error but the point is very clear.

    These are my settings:

    E4 355
    E5 Nothing
    E6 Formula bellow

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


    These are the procedures.

    The one using the method:
    Please Login or Register  to view this content.

    The one using the Dialog:
    Please Login or Register  to view this content.
    My results were more or less the following:
    Type Time Percent
    No Dialog 0.03515625 0.753%
    Dialog 4.63281250 99.247%

    Thanks
    Last edited by fredlo2010; 10-12-2014 at 08:55 AM.

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

    Re: Goalseek in VBA - Is it possible to see how many iterations were used?

    Here's a thread I started with a similar question: http://www.excelforum.com/excel-form...ate-event.html I expect you could adapt this approach, especially if you are in VBA already, to count goal seek or Solver iterations.
    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. Formula Instead of Goalseek
    By Darreno in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 07-31-2014, 05:58 PM
  2. Similar to Goalseek
    By pizzle523 in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 12-30-2012, 11:18 AM
  3. GoalSeek & Index + GUI
    By defy in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 05-13-2012, 07:23 PM
  4. [SOLVED] GoalSeek in VBA
    By [email protected] in forum Excel General
    Replies: 1
    Last Post: 07-20-2006, 12:20 AM
  5. 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