Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Round up to next number

29 views
Skip to first unread message

DevourU

unread,
Nov 3, 2005, 12:14:46 PM11/3/05
to
I need to round up to nearest number. 3.2 is 4, 3.9 is 4. TIA folks!

-JS


xRoachx

unread,
Nov 3, 2005, 1:15:08 PM11/3/05
to
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)

DevourU

unread,
Nov 3, 2005, 1:48:07 PM11/3/05
to
D'oh!

-JS

"xRoachx" <xRo...@discussions.microsoft.com> wrote in message
news:3359C758-0012-474E...@microsoft.com...

DK

unread,
Nov 3, 2005, 2:32:04 PM11/3/05
to


Try This : Round(Your number or variable, Digits)

OldNumber = 3.1477898522
MyNewNumber = Round(OldNumber, 3)
MyNewNumber = 3.145

Lynn Trapp

unread,
Nov 3, 2005, 3:27:41 PM11/3/05
to
Round([SomeNumberField] + .49999999) will always round up to the next
number.

--
Lynn Trapp
MS Access MVP
www.ltcomputerdesigns.com
Access Security: www.ltcomputerdesigns.com/Security.htm
Jeff Conrad's Access Junkie List:
http://home.bendbroadband.com/conradsystems/accessjunkie.html

"DevourU" <dev...@hotmail.com> wrote in message
news:aAraf.7954$D13....@newssvr11.news.prodigy.com...

DBS

unread,
Nov 3, 2005, 4:39:12 PM11/3/05
to
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

DevourU

unread,
Nov 3, 2005, 6:37:15 PM11/3/05
to
That's it. I couldn't put that together, brain dead day.

-JS

"Lynn Trapp" <ltrapp...@ltcomputerdesigns.com> wrote in message
news:%23cTSLUL...@tk2msftngp13.phx.gbl...

Van T. Dinh

unread,
Nov 3, 2005, 7:25:18 PM11/3/05
to
You can use:

- Int( - [YourNumber] )

e.g.:

?-Int(-3.2)
4

--
HTH
Van T. Dinh
MVP (Access)

"DevourU" <dev...@hotmail.com> wrote in message
news:aAraf.7954$D13....@newssvr11.news.prodigy.com...

James A. Fortune

unread,
Nov 4, 2005, 11:37:40 AM11/4/05
to
Van T. Dinh wrote:
> 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

0 new messages