View Single Post
  #5   Report Post  
Posted to microsoft.public.excel.worksheet.functions
macropod macropod is offline
external usenet poster
 
Posts: 329
Default Purging ZIPCODES from a string of cities and zips

Hi Bruce,

Update:
In Word, if you do a Find/Replace with the "Find" text being '[ (a-zA-Z)]',
check the 'Use
wildcards' option and have no "Replace" text, your string will go from:
Castro Valley (94546), Castro Valley (94552), Danville (94526), Fremont
(94555), Hayward (94540), Hayward (94545), Hayward (94557), Oakland (94601),
San Leandro (94577), San Leandro (94578), San Lorenzo (94580), San Ramon
(94582), San Ramon (94583), Union City (94587)
to:
94546,94552,94526,94555,94540,94545,94557,94601,94 577,94578,94580,94582,9458
3,94587
in one step.

The Word macro equivalent would be:
Sub ZipCodeMacro()
With Selection.Find
.ClearFormatting
.Replacement.ClearFormatting
.Text = "[ (a-zA-Z)]"
.Replacement.Text = ""
.Forward = True
.Wrap = False
.MatchWildcards = True
.Execute Replace:=wdReplaceAll
End With
End Sub

Cheers
--
macropod
[MVP - Microsoft Word]



What I need it to do is to take something like
Newark (94560), East Palo Alto (94303), Fremont (94536), Fremont

(94538),
Fremont (94539), Fremont (94555), Hayward (94540), Hayward (94545),

Hayward
(94557), Union City (94587)

and turn it into

94560, 94303, 94536, 94538, 94539, 94555, 94540, 94545, 94557, 94587

I have been using word (convert text to table then table to text, text

to
table using the ( for the seperator, then cut column, convert to text,

then
replace the )^p with a ,

This works, but is cludgy and I need to do this about 40-50 times a day.

I would ideally like to paste in one cell, and then the next cell would

have
my desired out put in the next cell.

Thanks,
Bruce