Welcome to SPN

Register and Join the most happening forum of Sikh community & intellectuals from around the world.

Sign Up Now!

Round up to next number

Discussion in 'Information Technology' started by DevourU, Nov 4, 2005.

Tags:
  1. DevourU

    DevourU
    Expand Collapse
    Guest

    I need to round up to nearest number. 3.2 is 4, 3.9 is 4. TIA folks!

    -JS
     
  2. Loading...

    Similar Threads Forum Date
    UK Turban Kicked off His Head & Beaten to the Ground, Sikh Lawyer's Day in Court Begins Breaking News Jan 23, 2014
    General Teenager Admits She Punched Sikh Pensioner, 80, To The Ground Hard Talk Oct 19, 2013
    Movies Ashdoc's half complete movie review---Frozen ground Theatre, Movies & Cinema Sep 7, 2013
    SciTech B-School Startup: Turning Coffee Grounds Into Food Breaking News Sep 2, 2013
    Canada The Money Merry-Go-Round Breaking News Jul 10, 2013

  3. xRoachx

    xRoachx
    Expand Collapse
    Guest

    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" wrote:

    > I need to round up to nearest number. 3.2 is 4, 3.9 is 4. TIA folks!
    >
    > -JS
    >
    >
    >
     
  4. DevourU

    DevourU
    Expand Collapse
    Guest

    D'oh!

    -JS

    "xRoachx" <xRoachx@discussions.microsoft.com> wrote in message
    news:3359C758-0012-474E-AE61-670CE9F7B501@microsoft.com...
    > 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" wrote:
    >
    >> I need to round up to nearest number. 3.2 is 4, 3.9 is 4. TIA folks!
    >>
    >> -JS
    >>
    >>
    >>
     
  5. DK

    DK
    Expand Collapse
    Guest

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


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

    "DevourU" wrote:

    > D'oh!
    >
    > -JS
    >
    > "xRoachx" <xRoachx@discussions.microsoft.com> wrote in message
    > news:3359C758-0012-474E-AE61-670CE9F7B501@microsoft.com...
    > > 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" wrote:
    > >
    > >> I need to round up to nearest number. 3.2 is 4, 3.9 is 4. TIA folks!
    > >>
    > >> -JS
    > >>
    > >>
    > >>

    >
    >
    >
     
  6. Lynn Trapp

    Lynn Trapp
    Expand Collapse
    Guest

  7. DBS

    DBS
    Expand Collapse
    Guest

    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" wrote:

    > I need to round up to nearest number. 3.2 is 4, 3.9 is 4. TIA folks!
    >
    > -JS
    >
    >
    >
     
  8. DevourU

    DevourU
    Expand Collapse
    Guest

    That's it. I couldn't put that together, brain dead day.

    -JS

    "Lynn Trapp" <ltrapp_NOSPAM@ltcomputerdesigns.com> wrote in message
    news:%23cTSLUL4FHA.820@tk2msftngp13.phx.gbl...
    > 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" <devouru@hotmail.com> wrote in message
    > news:aAraf.7954$D13.7253@newssvr11.news.prodigy.com...
    >>I need to round up to nearest number. 3.2 is 4, 3.9 is 4. TIA folks!
    >>
    >> -JS
    >>

    >
    >
     
  9. Van T. Dinh

    Van T. Dinh
    Expand Collapse
    Guest

    You can use:

    - Int( - [YourNumber] )

    e.g.:

    ?-Int(-3.2)
    4

    --
    HTH
    Van T. Dinh
    MVP (Access)



    "DevourU" <devouru@hotmail.com> wrote in message
    news:aAraf.7954$D13.7253@newssvr11.news.prodigy.com...
    >I need to round up to nearest number. 3.2 is 4, 3.9 is 4. TIA folks!
    >
    > -JS
    >
     
  10. James A. Fortune

    James A. Fortune
    Expand Collapse
    Guest

    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
     

Share This Page