Round currency to 4 decimal places in excel 2007 vba

Posted on 2011-10-05
Last Modified: 2012-05-12
Hi all.

I have the code below that formats column I into currency. But instead of rounding to 2 decimal places I would like it to round to 4 decimal places. How can I do this?

Thank you in advance!
.Range("I3:I" & rng2).Style = "Currency"

Open in new window

Question by:printmedia
    1 Comment
    LVL 24

    Accepted Solution

    Maybe tweak this as necessary?
    .Range("I3:I" & rng2).NumberFormat = "$0.0000"

    Open in new window


    Featured Post

    How your wiki can always stay up-to-date

    Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
    - Increase transparency
    - Onboard new hires faster
    - Access from mobile/offline

    Join & Write a Comment

    A little background as to how I came to I design this code: Around 5 years ago I designed an add-in that formatted Excel files to a corporate standard, applying different cell colours and font type depending on whether the cells contained inputs,…
    INDEX and MATCH can be used to great effect to replace HLOOKUP and VLOOKUP as it does not have the limitation of needing the data to be sorted so that the reference value is in the first column or row. It also has the ability to perform a bi-directi…
    This Micro Tutorial will demonstrate how to use a scrolling table in Microsoft Excel using the INDEX function.
    This Micro Tutorial will demonstrate how to create pivot charts out of a data set. I also added a drop-down menu which allows to choose from different categories in the data set and the chart will automatically update.

    731 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    15 Experts available now in Live!

    Get 1:1 Help Now