View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.programming
[email protected] paul.robinson@it-tallaght.ie is offline
external usenet poster
 
Posts: 789
Default find replace within sheet or workbook

Hi
Why not do
For each wks in Activeworkbook.worksheets
wks.Activate
Cells.Replace What:="a", Replacement:="b", Within:=xlSheet
next wks

The wks.Activate may not be required.
regards
Paul

On Apr 23, 11:30 am, mcphc wrote:
Is there a way to change the search within feild in the replace command from
"sheet" to "workbook"?

ie something like:

Cells.Replace What:="a", Replacement:="b", Within:=xlSheet

The within option in replace doesn't seem to be covered in VB Cells.Replace
yet Cells.Replace is effected by what ever the Within option is set to using
the normal find/replace command in excel.

The only other idea I have come up with is using sendkeys but sendkeys may
not be very robust.