I´ve been struggling witht this for a while, please help...
I want to store range("G7:G200") as arr1, then store range ("A7:C500") as arr2, also have a third array called arr3, then I need to vlookup all the values for arr1 in arr2 and store the results in arr3, then write arr3 in range("H1:H200"). I need to do this in VBA and store the results as variables in another array, because I will perform more calculations based on the result of the vlookup, also this is as a test, actual values to vlookup and return results are about 4,000
so far...
sub looking()
dim arr1() as variant
dim arr2() as variant
dim arr3() as variant
arr1= range("G7:G200").value
arr2= range("A7:C500").value
for i=1 to 200
arr3(i,1)=worksheetfunction.vlookup(arr1(i,1),arr2,2,false)
next i
range("H1:H200").value=arr3
end sub
What is wrong with this?!
I want to store range("G7:G200") as arr1, then store range ("A7:C500") as arr2, also have a third array called arr3, then I need to vlookup all the values for arr1 in arr2 and store the results in arr3, then write arr3 in range("H1:H200"). I need to do this in VBA and store the results as variables in another array, because I will perform more calculations based on the result of the vlookup, also this is as a test, actual values to vlookup and return results are about 4,000
so far...
sub looking()
dim arr1() as variant
dim arr2() as variant
dim arr3() as variant
arr1= range("G7:G200").value
arr2= range("A7:C500").value
for i=1 to 200
arr3(i,1)=worksheetfunction.vlookup(arr1(i,1),arr2,2,false)
next i
range("H1:H200").value=arr3
end sub
What is wrong with this?!