将此宏粘贴到工作簿的宏编辑器中 (ALT+F11)
Sub test()
Dim w As Worksheet, r As Range
For Each w In ThisWorkbook.Worksheets
For Each r In w.UsedRange
If r.Value = "Certain text" Or r.Formula = "Certain Formula" Then
'Do what you want to do here
End If
Next
Next
End Sub
希望这可以帮助