Results 1 to 2 of 2

Thread: 5 digit zip code in CSV using visual basic

  1. #1

    Thread Starter
    New Member
    Join Date
    Nov 2005
    Posts
    1

    5 digit zip code in CSV using visual basic

    Iam accessing a csv file in visual basic program. A column in csv file has got zip codes, but there is formating problem with zip code for eg. 07001 or 08820 is displayed as 7001 or 8820. Iam not able to set the format of the column in my program .
    I tried using
    1) selection.numberformat = "00000"
    2) selection.numberformat = "@" and then adding the leading zeros.

    Can some one please suggest any solution to fix this problem of leading zero's.

  2. #2
    Super Moderator si_the_geek's Avatar
    Join Date
    Jul 2002
    Location
    Bristol, UK
    Posts
    41,974

    Re: 5 digit zip code in CSV using visual basic

    Moved from FAQ forum

    Hi san1978, welcome to VBForums!

    The problem is that numbers are not shown with preceeding 0's, so using a number format is not appropriate. You should select a text format instead, as this will preserve the leading zeroes.

Posting Permissions

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



Click Here to Expand Forum to Full Width