Latchmaker
Active Member
- Joined
- Sep 30, 2005
- Messages
- 308
I have a code that I want to run against any sheet within an active workbook however the find function in VBA limits the search to the active sheet not all sheets....Please Help this is my code.
Sub FindX()
On Error GoTo MyErrorHandler
Cells.Find(What:="x:", After:=ActiveCell, LookIn:=xlFormulas, LookAt:= _
xlPart, SearchOrder:=xlByRows, SearchDirection:=xlNext, MatchCase:=False _
, SearchFormat:=False).Activate
Exit Sub
MyErrorHandler:
Msg = "No Links to the X:Drive Found...Have A Good Day!!"
MsgBox Msg
Exit Sub
End Sub
I want the code to loop through all sheets and if there is no Link to X: then return the Msg...if there is a link I want to go to that cell.
Sub FindX()
On Error GoTo MyErrorHandler
Cells.Find(What:="x:", After:=ActiveCell, LookIn:=xlFormulas, LookAt:= _
xlPart, SearchOrder:=xlByRows, SearchDirection:=xlNext, MatchCase:=False _
, SearchFormat:=False).Activate
Exit Sub
MyErrorHandler:
Msg = "No Links to the X:Drive Found...Have A Good Day!!"
MsgBox Msg
Exit Sub
End Sub
I want the code to loop through all sheets and if there is no Link to X: then return the Msg...if there is a link I want to go to that cell.