+ Reply to Thread
Results 1 to 6 of 6

Function does not round!

  1. #1
    Registered User
    Join Date
    03-20-2014
    Location
    canada
    MS-Off Ver
    Excel 2013
    Posts
    8

    Function does not round!

    Hi everyone,

    I am running into an issue I can't solve right now. I've done a complex VBA add-in for my office which around 30 people uses. It always ran smooth until I made an update to one section of code.

    The code is calculating areas for metal steel deck with given values and needs to round distances according to the sheet's dimensions.

    It is working good on my computer and with a sample test I get a rounded value for the width (lets say 30), but on someone's pc, the round function is not applied and he gets like 27.143214.

    How is it possible?

    I tried the round.up and ceiling function.

    His computer and Excel settings are exactly like mine.

    I also tried it on his coworker's pc and it worked!

    I just don't understand how a line of code can't work on one particular computer -__-'

    Please Login or Register  to view this content.
    Last edited by tnt59; 10-07-2015 at 03:46 PM.

  2. #2
    Forum Moderator - RIP Richard Buttrey's Avatar
    Join Date
    01-14-2008
    Location
    Stockton Heath, Cheshire, UK
    MS-Off Ver
    Office 365, Excel for Windows 2010 & Excel for Mac
    Posts
    29,464

    Re: Function does not round!

    Hi,

    Is it only with the width and not the height?

    How are the variables dTotalWidth, Deck.dsheetLength & Deck.iSideLap defined and what are their values when they are first encountered.

    Upload the workbook so that we can see your problem in context and tell us how you operate it.
    Richard Buttrey

    RIP - d. 06/10/2022

    If any of the responses have helped then please consider rating them by clicking the small star icon below the post.

  3. #3
    Registered User
    Join Date
    03-20-2014
    Location
    canada
    MS-Off Ver
    Excel 2013
    Posts
    8

    Re: Function does not round!

    Nothing to see here
    Last edited by tnt59; 10-07-2015 at 01:58 PM.

  4. #4
    Registered User
    Join Date
    03-20-2014
    Location
    canada
    MS-Off Ver
    Excel 2013
    Posts
    8

    Re: Function does not round!

    No one has ever seen such problem?

    How can it not work from one computer to the other!


  5. #5
    Forum Moderator - RIP Richard Buttrey's Avatar
    Join Date
    01-14-2008
    Location
    Stockton Heath, Cheshire, UK
    MS-Off Ver
    Office 365, Excel for Windows 2010 & Excel for Mac
    Posts
    29,464

    Re: Function does not round!

    Can we try to eliminate the VB Environment

    What happens if you just use a normal =ROUNDUP(A1) function on a worksheet. Do this in two ways
    1. Create a workbook with say 27.143214 in A1 and apply the Roundup function. Then send that workbook to your colleague who gets a different result on his PC

    2. Let your colleague add 27.143214 directly in his workbook on his PC and apply the function.

    What happens?

  6. #6
    Registered User
    Join Date
    03-20-2014
    Location
    canada
    MS-Off Ver
    Excel 2013
    Posts
    8

    Re: Function does not round!

    Ok, so I did some heavy debugging with the user and I found the problem is much deeper than I though.

    The round function is working correctly, it was a decimalseparator thing.

    The Application.DecimalSeparator was giving me the wrong setting :

    If the system is set to point and Excel uses the system separator, but has a comma in the grey box (because it's not used), this line gives me the comma!

    I needed to write Application.International(xlDecimalSeparator) to have the real one.

    I feel stupid ahah

    I have other questions now, because of the comma and the strange things it can make in VB, but i'll keep it to another thread.

    Thanks for your help Richard!

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Help with ROUND function
    By onp in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 03-28-2014, 06:20 AM
  2. [SOLVED] If Statement with a Divisible-By function and Round Function
    By thanhie in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 11-06-2013, 01:00 AM
  3. [SOLVED] Conditional Round up or Round up Function
    By cdmterence in forum Excel Programming / VBA / Macros
    Replies: 17
    Last Post: 09-18-2013, 06:03 PM
  4. Problem Inserting Round function into an IF function
    By Ash87 in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 01-11-2013, 05:37 PM
  5. [SOLVED] ROUND function help
    By jcmurtha in forum Excel General
    Replies: 3
    Last Post: 05-08-2011, 02:26 PM
  6. [SOLVED] VB Function Round vs Excel function Round not behaving the same Od
    By Bud in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 08-18-2006, 12:45 AM
  7. [SOLVED] The ROUND function
    By Louise in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 09-06-2005, 02:05 AM

Tags for this Thread

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