View Single Post
  #4   Report Post  
vezerid
 
Posts: n/a
Default corresponding data

Jack,
Of course you can always use formula and then Copy|Paste Special... |
Values, to eliminate any trace of formulas. Still, this is a search
problem where the source data is not ordered and as such it would
require rather elaborate data structures and algorithms to solve in
less than O(m*n), where m is the number of rows in SheetA and n is the
number of rows in your target sheet. VLOOKUP is itself efficiently
written. So the best I can come up with is using VLOOKUP from VBA.

Sub MyVlookup()
dim sh1 as worksheet, sh2 as worksheet
Set sh1 = thisworkbook.sheets("SheetA")
Set sh2 = thisworkbook.sheets("SheetB")

i=2
while sh2.cells(i,13)<""
sh2.cells(i,14) =
application.worksheetfunction.vlookup(cells(i,13),
sh2.range("AU:BI"),15,false)
i=i+1
wend
end sub

HTH
Kostis