Re: controlling the Range.Replace method.



Resetting the search scope:
http://groups.google.com/group/microsoft.public.excel.programming/browse_thread/thread/c0ff9e29ec75f30d/576082458637e4e6?lnk=st&q=excel+vba+replace+workbook+***&rnum=4&hl=en#576082458637e4e6

For the formattting options, recording a macro while searching using
formatting will give you a good idea of the syntax.

Eg:

Application.FindFormat.Clear
With Application.FindFormat.Interior
.ColorIndex = 6
.Pattern = xlSolid
.PatternColorIndex = xlAutomatic
End With


Tim


"T-Casey" <TCasey@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:C00F610E-806F-4382-86DC-714BF5C29AD3@xxxxxxxxxxxxxxxx
Thanks in advance,

I have a problem when ttrying to use the range.replace method in excel. If
I
have left the find/replace environment in "within" "Workbook" mode and run
my
VBA code. The routine will update the entire workbook instead of the
selected
range as I would expect.

Is ther a way in VBA to reset the "within" setting to "***" prior to
executing the Replace method?

Also, can anyone give a quick explination to Searchformat & ReplaceFormat
parameters to this function. I can only find examples where they are set
to
false. And the Microsoft documentation is not very helpful.

--
Tom Casey
Project Supervisor
sanofi-aventis


.