Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
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.


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
can't roundup sum swell estimator Excel Worksheet Functions 3 September 4th 08 03:48 AM
INT to ROUNDUP Skinman Excel Programming 5 August 25th 08 08:54 PM
RoundUP juanpablo Excel Discussion (Misc queries) 11 July 9th 08 11:11 PM
Roundup Dennis1188 Excel Discussion (Misc queries) 5 March 6th 07 08:08 PM
ROUNDUP copy/paste and fill handle not working Jason Southco Excel Worksheet Functions 1 October 10th 05 05:41 PM


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

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

About Us

"It's about Microsoft Excel"