Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Error 1004
I have an error handling process within a For...next loop. If error 1004
occurs then the error handler gets activated. Once the error handling is finished the next record in the loop is processed. I am using a vlookup to match a value in a column. If the value does not exist, I get error 1004. I put the following error handler in which works great the first time through the loop but if a second lookup value does not exist the error handling process does not get activated. For nr = 2 to lnr On Error GoTo errorhandler: mtch = Application.WorksheetFunction.VLookup( _ snamt, ActiveSheet.Range("T1:T5000"), 1, False) code to process if there is a match as a result of the lookup errorhandler: If Err = 1004 Then Worksheets("NABTemp").Activate Rows(nr).Select With Selection.Interior .ColorIndex = 6 .Pattern = xlSolid End With Err.Clear End If next nr Thanks, Mike |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Run time error 1004, General ODBC error | New Users to Excel | |||
Runtime error '1004' General ODBC error | New Users to Excel | |||
Excel 2003 Macro Error - Runtime error 1004 | Excel Discussion (Misc queries) | |||
naming tab macro error runtime error 1004 | Excel Programming | |||
Run time error 1004 General ODCB Error | Excel Programming |