I am trying to use VBA to do a FindReplace within a subset of sheets within a workbook and the code like this below works fine as long as the 'Within' parameter in the Find and Replace form is 'Sheet'
However if the 'Within' parameter is set to 'Workbook', all examples of "<Before>" in the Workbook are replaced, not just those in the Active Sheet. Within isn't a valid variable in the Replace Method although it is there in the Find and Replace form.
Any ideas on how to resolve this would be gratefully received.
Simon
Code:
Dim Rng As Range
Set Rng = ActiveSheet.Range("A1", "ZZ1000")
Rng.Replace What:="<Before>", Replacement:="After", LookAt:=xlPart, SearchOrder:=xlByRows, MatchCase:=False, _
SearchFormat:=False, ReplaceFormat:=False
Any ideas on how to resolve this would be gratefully received.
Simon