+ Reply to Thread
Results 1 to 4 of 4

Thread: goalseek macro rounds to two decimals. need 3!

  1. #1
    Registered User
    Join Date
    12-29-2011
    Location
    Ontario, Canada
    MS-Off Ver
    Excel 2003
    Posts
    2

    goalseek macro rounds to two decimals. need 3!

    hi everyone,
    i have a macro which goalseeks a cell to a user input number.
    However, when I put a number like 0.505 for the macro to goal seek, I end up with a final number of 0.51. Is there any way to get it to goal seek to 3 decimal places?

    THANKS in advance!!!
    ...
    i = 4
    Target = Cells(7, i).Value
    While Target <> "End"
    Cells(9, i).Select
    Cells(9, i).GoalSeek Goal:=Target, ChangingCell:=Cells(33, i)
    i = i + 1
    Target = Cells(7, i).Value
    Wend

    ...

  2. #2
    Forum Contributor
    Join Date
    12-20-2011
    Location
    United States, Ohio
    MS-Off Ver
    Excel 2010
    Posts
    242

    Re: goalseek macro rounds to two decimals. need 3!

    Just guessing here but would this work....
    Range("ENTER YOUR OUTPUT CELL HERE").Select
    Selection.NumberFormat = "0.000"

  3. #3
    Registered User
    Join Date
    12-29-2011
    Location
    Ontario, Canada
    MS-Off Ver
    Excel 2003
    Posts
    2

    Re: goalseek macro rounds to two decimals. need 3!

    nope this doesn't work either

  4. #4
    Valued Forum Contributor
    Join Date
    12-28-2011
    Location
    England
    MS-Off Ver
    Excel 2007
    Posts
    276

    Re: goalseek macro rounds to two decimals. need 3!

    Scale up your values (ie multiply them all by 10) then run the Goalseek and divide the result by 10 to get it to your 3dp.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

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.2.0