View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Norman Jones Norman Jones is offline
external usenet poster
 
Posts: 5,302
Default 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