View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
Gary''s Student Gary''s Student is offline
external usenet poster
 
Posts: 11,058
Default Getting info from FIND/REPLACE

I run something like:

Sub Macro2()
Dim ws As Worksheet
For Each ws In Worksheets
ws.Activate
Cells.Replace What:="xxx", Replacement:="yyy"
Next
End Sub

This runs over many, many sheets. Most sheets don't have the string. Is
there any way I can return something from Replace to tell me if any
replacements were actually made in a given sheet?

I would like to break out of the loop once I get to the sheet that contained
the string in question.
--
Gary's Student