amandarose80
Technical User
I have a search box in a spreadsheet that has 26 tabs (A-Z). This is so you can find a name or a client number.
This is the code I used:
Sheets(Array("A", "B", "C", "D", "E", "F", "G", "H", "I", "J", "K", "L", "M", "N", "O", "P", _
"Q", "R", "S", "T", "U", "V", "W", "X", "Y"
).Select
Sheets("A"
.Activate
Sheets("Z"
.Select Replace:=False
Selection.Find(What:=Sheets("main"
.Range("c7"
.Value, After:=ActiveCell, LookIn:=xlFormulas, _
LookAt:=xlPart, SearchOrder:=xlByRows, SearchDirection:=xlNext, _
MatchCase:=False, SearchFormat:=False).Activate
Sheets("Main"
.Range("c7"
.ClearContents
End Sub
But if the name is not present, you get a runtime '91' error. How can I make an error message appear instead??
Thanks for the help!!
This is the code I used:
Sheets(Array("A", "B", "C", "D", "E", "F", "G", "H", "I", "J", "K", "L", "M", "N", "O", "P", _
"Q", "R", "S", "T", "U", "V", "W", "X", "Y"
Sheets("A"
Sheets("Z"
Selection.Find(What:=Sheets("main"
LookAt:=xlPart, SearchOrder:=xlByRows, SearchDirection:=xlNext, _
MatchCase:=False, SearchFormat:=False).Activate
Sheets("Main"
End Sub
But if the name is not present, you get a runtime '91' error. How can I make an error message appear instead??
Thanks for the help!!