-
Find/Replace in Specific Workcheet
I am writing a macro to find and replace a certain string within a certain worksheet within a workbook. The macro I have found is below, but searches the entire workbook. Please can someone advise how to amend this to only look in one particular worksheet?
Sub FindReplaceAll()
Dim sht As Worksheet
Dim fnd AsVariant
Dim rplc AsVariant
fnd = "April"
rplc = "May"
ForEach sht In ActiveWorkbook.Worksheets
sht.Cells.Replace what:=fnd, Replacement:=rplc, _
LookAt:=xlPart, SearchOrder:=xlByRows, MatchCase:=False, _
SearchFormat:=False, ReplaceFormat:=False
Next sht
EndSub
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules