Results 1 to 3 of 3
  1. #1
    2 Star Lounger
    Join Date
    Mar 2002
    Location
    Western NY, USA
    Posts
    157
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Format as text (Excel 2002 sp3)

    I need to format cells as text so that number retain their leading zeros. If I do so from the menu, I get the results I want. However, I cannot see how to do this via code.

  2. #2
    Uranium Lounger
    Join Date
    Jan 2001
    Location
    South Carolina, USA
    Posts
    7,295
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Format as text (Excel 2002 sp3)

    The following will format column A to Text:

    <code>
    Range("A:A").NumberFormat = "@"
    </code>
    Legare Coleman

  3. #3
    2 Star Lounger
    Join Date
    Mar 2002
    Location
    Western NY, USA
    Posts
    157
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Format as text (Excel 2002 sp3)

    Thanks. I tried that, it did not work. I read your post so I tried it again. It helps if I type in the correct column number! Now I feel silly.

    Thanks again.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •