View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
michael.beckinsale michael.beckinsale is offline
external usenet poster
 
Posts: 274
Default Can this be done?

Hi all,

The snippet of code below is what l am using to replace "deposit "
with "deposit-". Where the spaces in "deposit " can be anything from
1 space to 6 spaces. Can l use a wildcard character such as * to do
this? Any suggestions gratefully received. For information the range
the replace is to work on covers 1 column with a dynamic number of rows
usually no more than 1000.

With ActiveSheet
On Error Resume Next
.Replace What:="DEPOSIT ", Replacement:="DEPOSIT-",
lookat:=xlPart, searchorder _

:=xlByRows, MatchCase:=False, SearchFormat:=False, ReplaceFormat:=False
On Error GoTo 0
End With

Regards

Michael Beckinsale