LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4
Default 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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Run time error 1004, General ODBC error [email protected] New Users to Excel 0 September 19th 05 01:41 AM
Runtime error '1004' General ODBC error star_lucas New Users to Excel 0 August 29th 05 04:09 PM
Excel 2003 Macro Error - Runtime error 1004 Cow Excel Discussion (Misc queries) 2 June 7th 05 01:40 PM
naming tab macro error runtime error 1004 D Excel Programming 3 February 28th 05 01:32 AM
Run time error 1004 General ODCB Error Kevin Excel Programming 3 February 26th 05 12:51 PM


All times are GMT +1. The time now is 04:52 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"