View Single Post
  #6   Report Post  
Posted to microsoft.public.excel.programming
Rick Rothstein Rick Rothstein is offline
external usenet poster
 
Posts: 5,934
Default RoundUp not working in VBA

I see you have resolved your problem, but I thought I might mention that
although VB does not have a ROUNDUP function equivalent without going to the
worksheet functions, there is a simple math procedure to do the same thing
you are looking for (round up to an integer)...

If Variable is always non-negative: x = -Int(-Variable)

If negative values are permitted: x = -Sgn(R) * Int(-Abs(R))

--
Rick (MVP - Excel)


wrote in message
...
Can anyone provide insight into why the following is not working?

x = Application.WorksheetFunction.RoundUp((cost * follow_up), 0)

cost = 1
follow_up = 0.5

but x is coming out as 0 instead of 1

Thanks.