LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.newusers
external usenet poster
 
Posts: 47
Default vba GOAL SEEK

Hi,
I would like to make a command.button that runs the goal.seek formula for me.

I have a cell that has the total value for a series of equasions.
lets call it "TOTAL" and it usualy is a number like 543.23

Some times i need it to round it to 543, but not aways. and i cant just
round it. the value must come out from somewere. there is were the goal.seek
come in.

so, the goal.seek formula in VBA is
goalseek(Goal,ChangingCell As Range)As Boolean

and my curent formula for the button is
Private Sub CommandButton1_Click()
Sheets("ADITIVO").Select
Range("E57").Select
ActiveCell.FormulaR1C1 = "=ROUND(RC[-2],0)"
Cells(57, 5) = i
Range("C57").GoalSeek Goal:=i, ChangingCell:=Sheets("GERAL").Range("M6")

End Sub

when I hit the button, the result is always "ZERO"
I wich someone could help me figure out how do I substitute the valeu "i"in
the formula for the value inside the E57 cell that has the TOTAL rounded and
it is the valeu that i am expecting.



 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Goal seek - Is there a bug? Petros[_2_] Excel Discussion (Misc queries) 3 February 21st 08 05:42 PM
How to use goal seek manu Excel Worksheet Functions 2 July 8th 07 11:10 PM
goal seek tikchye_oldLearner57 Excel Discussion (Misc queries) 3 August 31st 06 02:52 PM
Goal seek gone [email protected] Excel Worksheet Functions 2 August 29th 06 04:57 PM
Goal Seek Mike Excel Worksheet Functions 3 January 23rd 06 04:39 AM


All times are GMT +1. The time now is 07:49 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"