View Single Post
  #7   Report Post  
Posted to microsoft.public.excel.programming
Otto Moehrbach[_6_] Otto Moehrbach[_6_] is offline
external usenet poster
 
Posts: 201
Default Error Trap Not Working

Frank & Bob
Thanks for your help. I didn't include the variable declarations in my
post so, of course, you didn't know that FoundCell was a range. My error
was that I did not set FoundCell. Thanks for your help. Otto
"Otto Moehrbach" wrote in message
...
Excel 2002, WinXP
I have List1 on one sheet, List2 on another sheet, and a third sheet
selected. Many items in List1 are not in List2.
I have the following code with a simple error trap that is not

working.
I am getting an "Object variable not set..." error on the
FoundCell.......Find line. I am not seeing how that error could not be
trapped. What am I not seeing?
Thanks for your help. Otto
For Each i In List1
On Error GoTo Nexti
FoundCell = List2.Find(What:=i, LookAt:=xlWhole)
'Copy/Paste FoundCell & stuff
Nexti:
On Error GoTo 0
Next i