View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Don Guillett[_4_] Don Guillett[_4_] is offline
external usenet poster
 
Posts: 2,337
Default SUBSTITUTE using arrays?

You should use a macro for this. Record the action while you do it.

--
Don Guillett
SalesAid Software

"alpo " wrote in message
...
What I need to do is a massive search-and-replace-type thing.

Specifically, I have a ton of addresses. I want to edit out the useless
and repetative words like RD, LANE, PKWY, NORTH, SOUTH, NW, AVE.,
etc... and basically be left with "123 Maple 405" instead of "123 SW
Maple APT # 405".

I have a nice column of items to be deleted, but I can't figure out how
to apply that field to my other field of addresses.

I have used the SUBSTITUTE command, but it seems to work on only one
cell at a time. I need to specify ranges of cells.

Let's assume my addresses are in a1:a1000 and my "bad" phrases are in
c1:c25. My output column will be B1:b1000.

In B1, I can put:

=SUBSTITUTE($A1,$C$1,"")

I can copy it down the column and it works fine for a single
substitution (C1). But, what I need to do is something like this:

{=SUBSTITUTE($A1,$C$1:$C$25,"")}

Except that the above line doesn't work. It outputs exactly what the
source text is.

Am I going about this the completely wrong way or do I just need to
tweak it a little?


---
Message posted from
http://www.ExcelForum.com/