+ Reply to Thread
Results 1 to 3 of 3

Roundup in VBA

  1. #1
    Registered User
    Join Date
    01-17-2005
    Posts
    7

    Roundup in VBA

    Excel seems to round decimals in very odd ways. And Im having some difficulty getting the result I want.
    What I want it to do is anything that isnt a whole number should be rounded up to the next whole number. eg 1.75 = 2, 4.02 = 5, 2.5=3. Im sure this is very easy for you guys, can someone please help?

  2. #2
    Forum Guru Norie's Avatar
    Join Date
    02-02-2005
    Location
    Stirling, Scotland
    MS-Off Ver
    Microsoft Office 365
    Posts
    19,643
    How are you currently trying to round?

  3. #3
    Registered User
    Join Date
    12-08-2004
    Posts
    31
    I don't know if you have an answer to this yet...

    use the roundup function

    Dim LNumber As Long
    Dim RoundedNumber As integer

    LNumber = 1.57
    RoundedNumber = Application.WorksheetFunction.Roundup(LNumber,1)

    Check out the help file for the roundup function in your Excel help files if you need help with the syntax.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1