Yet ONE problem remains for me.
I want to lookup a value in column 7 of the cells A4:H64 in a certain worksheet. The worksheetname will be found in cell $B$1
I need this function on different worksheets, each worksheet contains another value in $B$1
Function MyFunction(rg As Range)
Dim searchSomething As String
searchSomething = Cells(2, Application.ThisCell.Column).Value
MyFunction = Application.WorksheetFunction.VLookup(searchSomething , rg.Value & "$A$4:$H$64", 7, False)
End Function
For instance in cell K2 I write:
= MyFunction($B$1)
because $B$1 contains the name of the worksheet I need to search in.
Apparently the second parameter: rg.Value & "$A$4:$H$64" is wrong, so MyFunction gives an error...
Bookmarks