Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Zip codes in mail merges
for each cell in Range(Cells(1,"D"),Cells(rows.count,"D").End(xlup) )
if len(cell.value) = 9 then cell.value = "'" & left(cell.value,5) & "-" & Right(Cell.value,4) end if Next Untested would be code to convert them. I can't say if there is built in support for it. -- Regards, Tom Ogilvy "Brucek" wrote in message ... I have fomatted a column containing bot 5 and 9 digit zip codes. However when I mailmerge these into a word document the "-" is missing in the 9 digit zip codes. When I click on a cell the number is actually a 9 digit number with no "-". How can I convert the numbers to text keeping the "-" or how do I mail merge keeping the proper zip code format. |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Zip codes in mail merges
If that doesn't work try cell.text on the right side, which
will take what you see. Format the column as text ahead of time. Better test these on a copy of the worksheet. --- HTH, David McRitchie, Microsoft MVP - Excel [site changed Nov. 2001] My Excel Pages: http://www.mvps.org/dmcritchie/excel/excel.htm Search Page: http://www.mvps.org/dmcritchie/excel/search.htm "Tom Ogilvy" wrote in message ... for each cell in Range(Cells(1,"D"),Cells(rows.count,"D").End(xlup) ) if len(cell.value) = 9 then cell.value = "'" & left(cell.value,5) & "-" & Right(Cell.value,4) end if Next Untested would be code to convert them. I can't say if there is built in support for it. -- Regards, Tom Ogilvy "Brucek" wrote in message ... I have fomatted a column containing bot 5 and 9 digit zip codes. However when I mailmerge these into a word document the "-" is missing in the 9 digit zip codes. When I click on a cell the number is actually a 9 digit number with no "-". How can I convert the numbers to text keeping the "-" or how do I mail merge keeping the proper zip code format. |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Dates as text in Mail merges | Excel Discussion (Misc queries) | |||
Dates as text in Mail merges | Excel Discussion (Misc queries) | |||
mail merge and zip codes | Excel Discussion (Misc queries) | |||
mail merge and zip codes | Excel Discussion (Misc queries) | |||
Mail Merges on Excel | Excel Discussion (Misc queries) |