S
shternm
I can't figure out how to set up VLOOKUP formula with 2 variabl
elements.
After the intial formula runs in the specified cell, I want 2 element
changed: the location of the result and the lookup value.
In the case below that would be B1 and A2.
Range("B1") = Application.WorksheetFunction.VLookup(Range("A2"
Range("data"), 2, False)
I've tried setting it up like this:
Dim i, k As Integer
For i = 1 To 2
For k = 1 To 2
Range("B" & k) = Application.WorksheetFunction.VLookup(Range("a"
i), Range("data"), 2, False)
Next
Next
But then I get it to run 4 times returning the same result in 2 cells.
Please help
elements.
After the intial formula runs in the specified cell, I want 2 element
changed: the location of the result and the lookup value.
In the case below that would be B1 and A2.
Range("B1") = Application.WorksheetFunction.VLookup(Range("A2"
Range("data"), 2, False)
I've tried setting it up like this:
Dim i, k As Integer
For i = 1 To 2
For k = 1 To 2
Range("B" & k) = Application.WorksheetFunction.VLookup(Range("a"
i), Range("data"), 2, False)
Next
Next
But then I get it to run 4 times returning the same result in 2 cells.
Please help