Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]() IF the below code throws up an error (i.e. lookup_value, a parameter passed into the sub/function is not contained in the worksheet) THEN (do something)... ELSE (do something else).... END IF I'm sure its trivial, any help appreciated. Cells.Find(What:=lookup_value, After:=ActiveCell, LookIn:=xlFormulas, LookAt _ :=xlWhole, SearchOrder:=xlByRows, SearchDirection:=xlNext, MatchCase:= _ False, SearchFormat:=False).Activate Many thanks Matt |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]() On Error Resume Next ' turns off normal error trapping ' your code that may fail here If Err.Number then ' Err.Number is error code. 0 = no error ' error handling here (Err.Description contains error message) End if On Error Goto 0 ' reset normal error trapping Matt wrote: IF the below code throws up an error (i.e. lookup_value, a parameter passed into the sub/function is not contained in the worksheet) THEN (do something)... ELSE (do something else).... END IF I'm sure its trivial, any help appreciated. Cells.Find(What:=lookup_value, After:=ActiveCell, LookIn:=xlFormulas, LookAt _ :=xlWhole, SearchOrder:=xlByRows, SearchDirection:=xlNext, MatchCase:= _ False, SearchFormat:=False).Activate Many thanks Matt |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
perfect, knew it would be simple.
many thanks |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
How do in perform trial and error method in excel? | Excel Worksheet Functions | |||
perform 1 function, stop, perform different function | Excel Discussion (Misc queries) | |||
Excel 2000 - Excel 2003 now throws 'runtime error' | Excel Programming | |||
[Q] Save As throws type mismatch error in control's code? | Excel Discussion (Misc queries) | |||
Format statement no longer throws an error | Excel Programming |