You have two copies of the sub in the module. Delete one.
Or replace all the code with this:
Sub DoCancelCells()
Const sWhat As String = "cancel"
Dim rFind As Range
Dim sAdr As String
Dim wks As Worksheet
For Each wks In ActiveWorkbook.Worksheets
With wks.Range("T1:T" & wks.Range("T" & Rows.Count).End(xlUp).Row)
Set rFind = .Find(What:=sWhat, _
LookIn:=xlValues, LookAt:=xlWhole, _
MatchCase:=False, MatchByte:=False)
If Not rFind Is Nothing Then
sAdr = rFind.Address
Do
FormatCell rFind
Set rFind = .FindNext(rFind)
Loop Until rFind.Address = sAdr
End If
End With
Next wks
End Sub
Sub FormatCell(r As Range)
With r.EntireRow.Interior
.Pattern = xlGray16
.PatternColorIndex = xlAutomatic
.ColorIndex = xlAutomatic
.TintAndShade = 0
.PatternTintAndShade = 0
End With
End Sub
Bookmarks