View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
Tom Ogilvy Tom Ogilvy is offline
external usenet poster
 
Posts: 27,285
Default 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.