Hi guys,
I am learning index and match. I have created two named range CustomerList and tblName
when i try to collect the return value from index formula i have the error: Application or object not defined
Can you shed some light into it please?
With Sheets("Name")
Range("A1").Select
lRow = .Range("A" & Rows.Count).End(xlUp).Row
LCol = ActiveCell.End(xlToRight).Column
Set rng = ActiveCell.Resize(lRow, LCol)
Set tblName = ActiveCell.Resize(lRow, 1)
ThisWorkbook.Names.Add Name:="CustomerList", RefersTo:=rng, Visible:=True
InputVal = Application.InputBox(Prompt:="Enter Name", Title:="User Input")
Num = Application.WorksheetFunction.Index("CustomerList", WorksheetFunction.Match("& InputVal &", tblName, 1), 1)
End With

I am learning index and match. I have created two named range CustomerList and tblName
when i try to collect the return value from index formula i have the error: Application or object not defined
Can you shed some light into it please?
With Sheets("Name")
Range("A1").Select
lRow = .Range("A" & Rows.Count).End(xlUp).Row
LCol = ActiveCell.End(xlToRight).Column
Set rng = ActiveCell.Resize(lRow, LCol)
Set tblName = ActiveCell.Resize(lRow, 1)
ThisWorkbook.Names.Add Name:="CustomerList", RefersTo:=rng, Visible:=True
InputVal = Application.InputBox(Prompt:="Enter Name", Title:="User Input")
Num = Application.WorksheetFunction.Index("CustomerList", WorksheetFunction.Match("& InputVal &", tblName, 1), 1)
End With
