View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Bernie Deitrick[_2_] Bernie Deitrick[_2_] is offline
external usenet poster
 
Posts: 176
Default Using Find & Replace in macro

Bob,

Replace PARK with a placeholder, do your replacement, and restore the
PARKs. This will work as long as XXXX doesn't appear anywhere in your
data set.

With Columns("B:B")
..Replace What:="PARK", Replacement:="XXXX", LookAt:=xlPart
..Replace What:="PAR", Replacement:="PARK", LookAt:=xlPart
..Replace What:="XXXX", Replacement:="PARK", LookAt:=xlPart
End With

HTH,
Bernie
MS Excel MVP

"Bob C" wrote in message
...
Hi Everyone

I have a speadsheet with columns of credit card
transactions.
Column B contains the name & address of the retailers as
show below:

FOODLAND PARKLAND PAR
SAMS SEAFOOD RICHMOND PAR
SHELL SELF SERVE ELIZABETH VLE
DICK SMITH W8080 ELIZABETH CIT

How do I Find and Replace all instances of PAR on the
right hand end of cell with PARK without changing
PARKLAND to PARKKLAND with two "K's" ?.

TIA

Bob C