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.
Re: 5 digit zip code in CSV using visual basic
Moved from FAQ forum
Hi san1978, welcome to VBForums! :wave:
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.