+ Reply to Thread
Results 1 to 3 of 3

Converting text to number, dropping leading zero

  1. #1
    Registered User
    Join Date
    08-05-2009
    Location
    Jacksonville, FL
    MS-Off Ver
    Excel 2007
    Posts
    18

    Converting text to number, dropping leading zero

    I have a macro that goes out to a database and pulls in updated numbers. However the numbers come in as text because they have leading 0's:
    011204
    011208
    011209
    015942
    017536

    The only way I can get the numbers formatted as a number and drop the leading 0 is to click on the yellow exclamation tab that pops up and click, Convert to Number. Is there any way I can write this into my macro to automatically do for me?

    I tried selecting the column and reformatting this way but it would not drop the leading zero:

    Please Login or Register  to view this content.
    Any help would be appreciated! Thanks!
    Last edited by MichelleW; 09-09-2009 at 04:35 PM.

  2. #2
    Forum Guru DonkeyOte's Avatar
    Join Date
    10-22-2008
    Location
    Northumberland, UK
    MS-Off Ver
    O365
    Posts
    21,531

    Re: Converting text to number, dropping leading zero

    If the range is contiguous you may find:

    Please Login or Register  to view this content.
    please remember to use code tags when posting any VBA

  3. #3
    Registered User
    Join Date
    08-05-2009
    Location
    Jacksonville, FL
    MS-Off Ver
    Excel 2007
    Posts
    18

    Re: Converting text to number, dropping leading zero

    Thanks!! That works perfectly!! I appreciate the quick response!

+ 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