1) Open a new Access file
2) Save your Excel file as a .csv file
3) Import the .csv file into Access
4) Run an update query in Access:
Update to RIGHT('00000'+ Zip Code field,5)
or 9 if using long Zip Code
5) Copy access table and paste into Excel and SAVE AS .CSV
.... if saved as .xls You will lose the 0's again.
>--Original Message--
>Here is my issue: I have 19k zip codes in excel. They
where sent without
>the 0's to me. So many of the zip codes are only 3 or 4
digits instead
>of 5...ex (00235 looks like 235)
>So I went in and formatted the cells as a zip code
digits. Which
>visually corrected the field to display all 5 digits.
>However I am using a macro to cut and paste from excel
into another
>program (text field) and the macro cuts the cell and
pastes but the
>cells value is still 235 even though it is visually 00235
in the cell
>so the macro pastes 235 and the zip code is not correct.
I know that if
>I manually went in and put a '0 or '00 infront of the zip
codes that it
>would correct the situation. But I dont have the time to
do that for
>19k zip codes. Can someone please assist?
>Thanks
>Ryan
>
>--
>Message posted from
http://www.ExcelForum.com/>.
>
gregs
| Wed, 04 Jun 2008 12:02:00 GMT |