+ Reply to Thread
Results 1 to 6 of 6

leading zeroes disappear from phone #

  1. #1
    Registered User
    Join Date
    01-26-2005
    Posts
    3

    leading zeroes disappear from phone #

    I got an export with voter registration data, with 3 separate fields for area code, first 3 digits and last 4 digits. In the last column, if a number begins with 0 it just disappears, so you have a number that looks like 406 728 889. It's very confusing to our volunteers.

    Is there any way to format the cells so the zeroes are displayed? I know I can comment them out individually but is there any way to do it globally without overwriting the number?

  2. #2
    Forum Contributor
    Join Date
    06-23-2004
    Location
    Houston, TX
    Posts
    571
    Quote Originally Posted by caroljm36
    I got an export with voter registration data, with 3 separate fields for area code, first 3 digits and last 4 digits. In the last column, if a number begins with 0 it just disappears, so you have a number that looks like 406 728 889. It's very confusing to our volunteers.

    Is there any way to format the cells so the zeroes are displayed? I know I can comment them out individually but is there any way to do it globally without overwriting the number?
    Formatting the cells to "Text" will take care of this hopefully.

    Regards.
    BenjieLop
    Houston, TX

  3. #3
    Registered User
    Join Date
    08-10-2005
    Posts
    56

    Vba

    How do you go about achieving this in VBA??

    BAch

  4. #4
    Forum Contributor
    Join Date
    06-23-2004
    Location
    Houston, TX
    Posts
    571
    My VBA level is very superficial ... perhaps someone out there can take over from here.

    Regards.

  5. #5
    Dave Peterson
    Guest

    Re: leading zeroes disappear from phone #

    You could just give the 3 digit columns a custom format of: 000
    (Format|cells|number tab|custom)

    And the 4 digit column would have a custom format of: 0000

    If you're looking for code, you record a macro when you do it manually.

    It would look something like:

    activesheet.range("a:a").numberformat="000"



    caroljm36 wrote:
    >
    > I got an export with voter registration data, with 3 separate fields for
    > area code, first 3 digits and last 4 digits. In the last column, if a
    > number begins with 0 it just disappears, so you have a number that
    > looks like 406 728 889. It's very confusing to our volunteers.
    >
    > Is there any way to format the cells so the zeroes are displayed? I
    > know I can comment them out individually but is there any way to do it
    > globally without overwriting the number?
    >
    > --
    > caroljm36
    > ------------------------------------------------------------------------
    > caroljm36's Profile: http://www.excelforum.com/member.php...o&userid=19046
    > View this thread: http://www.excelforum.com/showthread...hreadid=471130


    --

    Dave Peterson

  6. #6
    Registered User
    Join Date
    08-10-2005
    Posts
    56

    thanks

    Thanks for your help.

+ 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