hello.
I want to execute the Xlookup function from vba without bothering writing the formula in an excel sheet. I think have checked every page google could offer me about the problem but I couldn't find satisfying results.
This for exemple return me: "Runtime error 1004: Unable to get the Xlookup property of the worksheetfunction class"
Sub searching()
Dim strSearched As String
Dim rngSearch As Range
Dim rngRenurned As Range
strSearched = "FSATA"
Set rngSearch = Sheets("asheet").Range("C:C")
Set rngRenurned = Sheets("asheet").Range("B:B")
MsgBox Application.WorksheetFunction.XLookup(strSearched, rngSearch, rngRenurned)
End Sub
Could it be a reference problem ? I wanted to collect informations about the Microsoft learn website but it seem Xlookup dont have any page on it.