Hi all,
I am trying to write a new function (myVLookup) without using "VLOOKUP" function.
I currently have 2 columns (A and B). If someone uses the abbreviation =myVLookup(i) in excel, where i is an element of column B, this formula need to return to him the element from column A. (same row, different column - I have used Offset??)
Function myVlookup(i) As Variant
Dim max As Single
Dim min As Single
Dim rng As Range
max = Application.WorksheetFunction.max(Range("b:b"))
min = Application.WorksheetFunction.min(Range("b:b"))
Set rng = Range("A1:B3")
For i = min To max
myVlookup(i) = Offset(0, -1)
Next i
End Function
Please can someone have a look and help if possible??????
Many thanks,
Christina
Bookmarks