View Single Post
  #5   Report Post  
Posted to microsoft.public.excel.programming
sebastienm sebastienm is offline
external usenet poster
 
Posts: 694
Default Finding data in another workbook

and once again , i forgot to reply to your main question...

instead of a loop, if you need to find the first instance of item2 in
destWB, you could use the FInd method of the Range object:

Dim rg As Range, item2 as string, rg as range
..
..
..
'search in whole column E
Set rg = destWB.Worksheets("Sheet1").Range("E:E").Find(item 2, , xlValues,
xlWhole)
If rg Is Nothing Then
MsgBox "not found"
Else
MsgBox "found at " & rg.Address
End If

--
Regards,
Sébastien
<http://www.ondemandanalysis.com