Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I'm using a macro to search for an item. If the item is not found, then I
receive an error. How can I tell the macro to goto Repeat: if the search criteria is not found? This is my search code. Selection.Find(What:=model, After:=ActiveCell, LookIn:= _ xlFormulas, LookAt:=xlPart, SearchOrder:=xlByRows, SearchDirection:= _ xlNext, MatchCase:=False).Select Thanks, Paul |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi Paul
try Dim rng as range on error resume next set rng = Selection.Find(What:=model, After:=ActiveCell, LookIn:= _ xlFormulas, LookAt:=xlPart, SearchOrder:=xlByRows, SearchDirection:= _ xlNext, MatchCase:=False) on error goto 0 if not rng is nothing then rng.select end if -- Regards Frank Kabel Frankfurt, Germany PCLIVE wrote: I'm using a macro to search for an item. If the item is not found, then I receive an error. How can I tell the macro to goto Repeat: if the search criteria is not found? This is my search code. Selection.Find(What:=model, After:=ActiveCell, LookIn:= _ xlFormulas, LookAt:=xlPart, SearchOrder:=xlByRows, SearchDirection:= _ xlNext, MatchCase:=False).Select Thanks, Paul |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Thanks!
"Frank Kabel" wrote in message ... Hi Paul try Dim rng as range on error resume next set rng = Selection.Find(What:=model, After:=ActiveCell, LookIn:= _ xlFormulas, LookAt:=xlPart, SearchOrder:=xlByRows, SearchDirection:= _ xlNext, MatchCase:=False) on error goto 0 if not rng is nothing then rng.select end if -- Regards Frank Kabel Frankfurt, Germany PCLIVE wrote: I'm using a macro to search for an item. If the item is not found, then I receive an error. How can I tell the macro to goto Repeat: if the search criteria is not found? This is my search code. Selection.Find(What:=model, After:=ActiveCell, LookIn:= _ xlFormulas, LookAt:=xlPart, SearchOrder:=xlByRows, SearchDirection:= _ xlNext, MatchCase:=False).Select Thanks, Paul |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
search a row for a word and if found | Excel Worksheet Functions | |||
Search and Goto | Excel Discussion (Misc queries) | |||
Found Cell Highlighting after Search | Excel Discussion (Misc queries) | |||
Return text found in a search | Excel Worksheet Functions | |||
The search key was not found error | New Users to Excel |