Hi all,
I want to find a value within the workbook.
Manually I would press CTRL + F, type the text in the FIND WHAT field, then set the WITHIN field to WORKBOOK.
When recoded this thru macro and tried to run it again, I got a debug error. See my code below
I noticed that the Sheet is set when the macro is recorded and that if this sheet is not the active one when I run this code, I get the debug error.
How do I fix this?
Thanks in advance
I want to find a value within the workbook.
Manually I would press CTRL + F, type the text in the FIND WHAT field, then set the WITHIN field to WORKBOOK.
When recoded this thru macro and tried to run it again, I got a debug error. See my code below
Code:
Sub Macro5()
Sheets("Main").Select
Cells.Find(What:="PATSYS", After:=ActiveCell, LookIn:=xlFormulas, LookAt:= _
xlWhole, SearchOrder:=xlByRows, SearchDirection:=xlNext, MatchCase:=False _
, SearchFormat:=False).Activate
End Sub
I noticed that the Sheet is set when the macro is recorded and that if this sheet is not the active one when I run this code, I get the debug error.
How do I fix this?
Thanks in advance