Round up to next number

  • Thread starter Thread starter DevourU
  • Start date Start date
As far as I know, there isnt a VBA function for this. But you can use a
worksheet function. Be sure to include a reference to the Excel Object
library. To use use the Roundup function from Excel, try:

WorksheetFunction.Roundup (YourField,0)
 
D'oh!

-JS

xRoachx said:
As far as I know, there isnt a VBA function for this. But you can use a
worksheet function. Be sure to include a reference to the Excel Object
library. To use use the Roundup function from Excel, try:

WorksheetFunction.Roundup (YourField,0)
 
Try This : Round(Your number or variable, Digits)


OldNumber = 3.1477898522
MyNewNumber = Round(OldNumber, 3)
MyNewNumber = 3.145
 
Try this plugging in this function:

Public Function RoundUp(dblNumberToRoundUp As Double)

Dim intRounded As Integer

intRounded = Round(dblNumberToRoundUp, 0)

If intRounded < dblNumberToRoundUp Then
intRounded = intRounded + 1
End If

RoundUp = intRounded

End Function
 
Van said:
You can use:

- Int( - [YourNumber] )

e.g.:

?-Int(-3.2)
4

It's so concise (and correct) that I can't improve on it. Well done.

James A. Fortune
 
Back
Top