I'm having this macro to find "HFM" from the sheet and if it exist then having some names written after it. No problem there. But how do I get this to run on all sheets at once?
This is what I have now but it only runs on the active sheet.
Sub test()
Dim ws As Worksheet
For Each ws In Worksheets
' Search for a text
Set MyObjectvie = Cells.Find(What:="HFM", After:=ActiveCell, LookIn:=xlFormulas, LookAt:= _
xlPart, SearchOrder:=xlByRows, SearchDirection:=xlNext, MatchCase:=False _
, SearchFormat:=False)
If Not MyObjectvie Is Nothing Then
' if the text is found do the task
Cells.Find(What:="HFM", After:=ActiveCell, LookIn:=xlFormulas, LookAt:= _
xlPart, SearchOrder:=xlByRows, SearchDirection:=xlNext, MatchCase:=False _
, SearchFormat:=False).Activate
ActiveCell.Offset(0, 1).Select
ActiveCell.FormulaR1C1 = "name1"
End If
Next ws
End Sub