View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.programming
Simon Letten Simon Letten is offline
external usenet poster
 
Posts: 20
Default Using Vlookup to add values to a spreadsheet

Having thought some more about this, I think I had the same problems and so
used the FIND method instead. This either returns a Range object variable or
Nothing.
--

Simon


"Simon Letten" wrote:

What is in your OnError code? Are you using the Resume keyword anywhere or
Err.Clear?
--

Simon


"MasterGee" wrote:


Hi,

I'm attempting to use vlookup to determine whether a value in one
spreadsheet (S1) is in another (S2), so that I can add that value to S2
if it isn't there. I'm checking all the values in S1 with a Do
While...Loop statement. I've coded so that OnError for the VLookUp, it
goes to the code that adds the value. This works perfectly for the
first value that cannot be found in S2, but for the second I get a
run-time 1004 error - 'Unable to get the Vlookup property of the
WorksheetFunction class'. I think that Excel is having a problem
dealing with an error when one is, effectively, still 'open', so to
speak. Can anyone help at all? This is driving me mad!

Regards,

MasterGee


--
MasterGee
------------------------------------------------------------------------
MasterGee's Profile: http://www.excelforum.com/member.php...o&userid=26372
View this thread: http://www.excelforum.com/showthread...hreadid=396462