View Single Post
  #4   Report Post  
Posted to microsoft.public.excel.programming
Vic Eldridge Vic Eldridge is offline
external usenet poster
 
Posts: 50
Default 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