Welcome to SPN

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

Sign Up Now!
  1. Monthly (Recurring) Target: $300 :: Achieved: $95   Become a Supporter    ::   Make a Contribution    Let's do it!

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
    GURU NANAK’S VISIT TO OTTOMAN EMPIRE-BACKGROUND New to Sikhism Jan 19, 2017
    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

  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
     
Since you're here... we have a small favor to ask...

More people are visiting & reading SPN than ever but far fewer are paying to sustain it. Advertising revenues across the online media have fallen fast. So you can see why we need to ask for your help. Donating to SPN's is vote for free speech, for diversity of opinions, for the right of the people to stand up to religious bigotry. Without any affiliation to any organization, this constant struggle takes a lot of hard work to sustain as we entirely depend on the contributions of our esteemed writers/readers. We do it because we believe our perspective matters – because it might well be your perspective, too... Fund our efforts and together we can keep the world informed about the real Sikh Sikhi Sikhism. If everyone who writes or reads our content, who likes it, helps us to pay for it, our future would be much more secure. Every Contribution Matters, Contribute Generously!

    Become a Supporter      ::     Make a Contribution     



Share This Page