Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 47
Default how not to go on Loop

hi,

I am trying to do a button that run a goalseek function.

the thing is:

Range("D21").GoalSeek Goal:=x, ChangingCell:=Range("D14")

the valeu X gotta be the ("D21") Value, rounded by 0
exemple if ("D21") is "12.32" X = 12
any way, i cant manage to doit without creating a loop, because as soons as
D21 is 12, X=0

i was able to make it wokr with a nasty copy and past.value way, but would
like to learn some other way...

Thanks in advance...

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 47
Default how not to go on Loop

I actualy was able to manage not looping the macro.
but I have a different ptoblem now...
my code is
Sub Goal ()
Dim total As Long
With Worksheets("Plan1")
total = .Cells("11", "F").Value
'MsgBox (total)
Range("F11").GoalSeek Goal:=total, ChangingCell:=Range("D5")
End With
End sub

the new problem is: if "F11" is smaller than 0.5 , it the long variable
rounds down. if its higher that .05 it rounds up. I always need to be rounded
down, even if my "F11" is 0.999999

i thank in advance for the help
if my
"Paulo" wrote:

hi,

I am trying to do a button that run a goalseek function.

the thing is:

Range("D21").GoalSeek Goal:=x, ChangingCell:=Range("D14")

the valeu X gotta be the ("D21") Value, rounded by 0
exemple if ("D21") is "12.32" X = 12
any way, i cant manage to doit without creating a loop, because as soons as
D21 is 12, X=0

i was able to make it wokr with a nasty copy and past.value way, but would
like to learn some other way...

Thanks in advance...

Reply
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
returning back to loop check condition without completing the loop ashish128 Excel Programming 13 April 3rd 08 12:53 PM
Loop to Filter, Name Sheets. If Blank, Exit Loop ryguy7272 Excel Programming 3 February 5th 08 03:41 PM
Naming Worksheets - Loop within a loop issue klysell Excel Programming 5 March 29th 07 05:48 AM
(Complex) Loop within loop to create worksheets klysell Excel Programming 1 March 20th 07 12:03 AM
Advancing outer Loop Based on criteria of inner loop ExcelMonkey Excel Programming 1 August 15th 05 05:23 PM


All times are GMT +1. The time now is 03:05 AM.

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

About Us

"It's about Microsoft Excel"