Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
VBA Floor/Celing commands
Okay, I am trying to figure out how to turn a value produced by a
formula and stored to a variable in my VB code into a whole number, but it needs to be rounded up no matter what the number (so if it is 32.004 the value needs to be passed as 33). In excel formulas, you can use floor or ceiling commands that can do this, but i cannot figure out how to do this in VB. Does anyone know how? Sample code below Dim cheese cheese = RWfLA.yards cheese = cheese / 9.5 [code to round number up] Thanks |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
VBA Floor/Celing commands
Hi Bohica,
Try: cheese = application.roundup(cheese,0) --- Regards, Norman "BOHICA" wrote in message m... Okay, I am trying to figure out how to turn a value produced by a formula and stored to a variable in my VB code into a whole number, but it needs to be rounded up no matter what the number (so if it is 32.004 the value needs to be passed as 33). In excel formulas, you can use floor or ceiling commands that can do this, but i cannot figure out how to do this in VB. Does anyone know how? Sample code below Dim cheese cheese = RWfLA.yards cheese = cheese / 9.5 [code to round number up] Thanks |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
VBA Floor/Celing commands
"Norman Jones" wrote in message ...
Hi Bohica, Try: cheese = application.roundup(cheese,0) --- Regards, Norman Norman, you are a freakin' genius. Exactly what value bumping I needed. Thanks |
#4
Posted to microsoft.public.excel.programming
|
|||
|
|||
VBA Floor/Celing commands
You can employ Excel's built-in functions via the WorksheetFunction object.
cheese = Application.WorksheetFunction.Ceiling(cheese,1) Regards, Vic Eldridge "BOHICA" wrote in message m... Okay, I am trying to figure out how to turn a value produced by a formula and stored to a variable in my VB code into a whole number, but it needs to be rounded up no matter what the number (so if it is 32.004 the value needs to be passed as 33). In excel formulas, you can use floor or ceiling commands that can do this, but i cannot figure out how to do this in VB. Does anyone know how? Sample code below Dim cheese cheese = RWfLA.yards cheese = cheese / 9.5 [code to round number up] Thanks |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
FLOOR FUNCTION | Excel Discussion (Misc queries) | |||
More function than FLOOR() ! | New Users to Excel | |||
floor function | Excel Worksheet Functions | |||
Something like CEILING or FLOOR | Excel Worksheet Functions | |||
ceiling & floor | New Users to Excel |