+ Reply to Thread
Results 1 to 5 of 5

Format columns to two decimal places

  1. #1
    Registered User
    Join Date
    06-20-2011
    Location
    England
    MS-Off Ver
    Excel 2003
    Posts
    91

    Format columns to two decimal places

    Hi...I have some code which splits data on one worksheet and copies to another worksheet. On this worksheet I have two columns which are amounts (coulmns I and J) and I would like these columns to be set to two decimal places.
    I don't want to have to manually format the columns. Is there a code available for this please? Thanks
    Last edited by fusion007; 06-24-2011 at 07:44 AM.

  2. #2
    Forum Expert sweep's Avatar
    Join Date
    04-03-2007
    Location
    Great Sankey, Warrington, UK
    MS-Off Ver
    2003 / 2007 / 2010 / 2016 / 365
    Posts
    3,444

    Re: Format columns to two decimal places

    Hi,

    How about

    Please Login or Register  to view this content.
    Rule 1: Never merge cells
    Rule 2: See rule 1

    "Tomorrow I'm going to be famous. All I need is a tennis racket and a hat".

  3. #3
    Registered User
    Join Date
    06-20-2011
    Location
    England
    MS-Off Ver
    Excel 2003
    Posts
    91

    Re: Format columns to two decimal places

    Hi Sweep...yes I had tried that but for some reason the amounts are still at 11 decimal places though on screen they appear at 2 decimal places.
    The first worksheet where all the data is entered the amount columns are set to two decimal places which is fine. On this worksheet a calculation is carried out to multiply the amounts with a formula and come up with the result and it is this new amount that is copied to another sheet. So I'm not sure if it becuase of the calculation that the amounts are not to two decimal places.
    Any ideas how to correct this?
    I am attaching extract of worksheet
    Attached Files Attached Files
    Last edited by fusion007; 06-24-2011 at 04:38 AM. Reason: Attachment

  4. #4
    Forum Expert sweep's Avatar
    Join Date
    04-03-2007
    Location
    Great Sankey, Warrington, UK
    MS-Off Ver
    2003 / 2007 / 2010 / 2016 / 365
    Posts
    3,444

    Re: Format columns to two decimal places

    So there are two options:

    1) Bound the calculation that generates the 11 decimal places inside a ROUND function, ie

    =ROUND(your_calculation,2)

    2) Round the values using VBA, for example, in your posted sheet

    Please Login or Register  to view this content.

  5. #5
    Registered User
    Join Date
    06-20-2011
    Location
    England
    MS-Off Ver
    Excel 2003
    Posts
    91

    Re: Format columns to two decimal places

    Thanks Sweep

+ 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