Nos
New Member
- Joined
- Feb 25, 2006
- Messages
- 20
Hi guys, I was hoping someone could give me some advice.
I'm running a Find through a specific selection. It works perfectly except for when the value it is searching for is not present in the selection. I tried to use the On Error command but the run time error box still comes up? Is there another way I can divert the macro if the value I am searching for is not found in the selection? (I need to take into account that sometimes the macro will search for values that are not in the selection.
Thanks for your help
I'm running a Find through a specific selection. It works perfectly except for when the value it is searching for is not present in the selection. I tried to use the On Error command but the run time error box still comes up? Is there another way I can divert the macro if the value I am searching for is not found in the selection? (I need to take into account that sometimes the macro will search for values that are not in the selection.
Thanks for your help
Code:
Selection.Find(What:=OfficeRecNo, After:=ActiveCell, LookIn:=xlValues, LookAt _
:=xlWhole, SearchOrder:=xlByColumns, SearchDirection:=xlNext, MatchCase _
:=False, SearchFormat:=False).Activate