Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
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.


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 691
Default 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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Dates as text in Mail merges Candida Excel Discussion (Misc queries) 0 August 17th 07 01:57 AM
Dates as text in Mail merges Duke Carey Excel Discussion (Misc queries) 0 August 17th 07 01:44 AM
mail merge and zip codes LStout Excel Discussion (Misc queries) 4 August 2nd 07 01:22 PM
mail merge and zip codes LStout Excel Discussion (Misc queries) 10 August 2nd 07 01:20 PM
Mail Merges on Excel evan Excel Discussion (Misc queries) 1 October 24th 06 04:36 AM


All times are GMT +1. The time now is 11:46 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"