+ Reply to Thread
Results 1 to 5 of 5

VBA Code to format a column to a specific number format

  1. #1
    Forum Contributor
    Join Date
    02-13-2016
    Location
    BMass
    MS-Off Ver
    2010
    Posts
    154

    VBA Code to format a column to a specific number format

    Hi,

    I am looking for help with a vba code to take numeric data in a specific column and auto adjust to a number format to show like:

    $1,000 ($1,000)

    However if you click in the cell it shows the number rounded the number to 2 decimals places only. So that is what's detected by formulas dependent on the cells.

    Thank you.

  2. #2
    Forum Guru xladept's Avatar
    Join Date
    04-14-2012
    Location
    Pasadena, California
    MS-Off Ver
    Excel 2003,2010
    Posts
    12,378

    Re: VBA Code to format a column to a specific number format

    Something like:

    Please Login or Register  to view this content.
    Last edited by xladept; 11-24-2018 at 02:39 PM.
    If I've helped you, please consider adding to my reputation - just click on the liitle star at the left.

    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~(Pride has no aftertaste.)

    You can't do one thing. XLAdept

    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~aka Orrin

  3. #3
    Forum Expert Mumps1's Avatar
    Join Date
    10-10-2012
    Location
    Toronto, Canada
    MS-Off Ver
    Excel 2010, 2013
    Posts
    7,821

    Re: VBA Code to format a column to a specific number format

    Change the column to suit your needs.
    Please Login or Register  to view this content.
    You can say "THANK YOU" for help received by clicking the Star symbol at the bottom left of the helper's post.
    Practice makes perfect. I'm very far from perfect so I'm still practising.

  4. #4
    Forum Guru
    Join Date
    09-10-2017
    Location
    Chippenham, England
    MS-Off Ver
    365
    Posts
    15,091

    Re: VBA Code to format a column to a specific number format

    If you want to round to 2 decimals as well try
    Please Login or Register  to view this content.

  5. #5
    Forum Guru xladept's Avatar
    Join Date
    04-14-2012
    Location
    Pasadena, California
    MS-Off Ver
    Excel 2003,2010
    Posts
    12,378

    Re: VBA Code to format a column to a specific number format

    Thanks for the rep!

+ 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. [SOLVED] Check Date Format Input into Excel Column with VBA code ("DD/MM/YYYY" format)
    By inoka in forum Excel Programming / VBA / Macros
    Replies: 44
    Last Post: 04-17-2018, 05:26 AM
  2. [SOLVED] Check Date Format Input into Excel Column with VBA code ("DD/MM/YYYY" format)
    By inoka in forum Excel Programming / VBA / Macros
    Replies: 24
    Last Post: 12-14-2017, 08:30 AM
  3. vba code to format a column to a specific format (SSSS X1111111)
    By JEAN1972 in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 01-18-2017, 03:16 PM
  4. Need formula or code to convert number(s) from custom format to number format
    By tuongtu3 in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 01-12-2015, 07:44 PM
  5. Custom number format code for hiding specific values on chart axes
    By rob_storrar in forum Excel Charting & Pivots
    Replies: 7
    Last Post: 11-25-2012, 12:27 AM
  6. How to format percentage column as a number format
    By acsishere in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 05-25-2008, 04:12 PM
  7. [SOLVED] Format a column wihtout using "Format-Cells-Number-category-etc"
    By serve in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 02-23-2006, 10:45 AM

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