Hello and thanks so much for any help that can be offered.
I am attempting to use the MATCH function to pass a cell in one worksheet as the lookup_value and a column in a second worksheet as the lookup_array. I am having trouble with the syntax and am looking for recommendations.
This is what I have:
Dim rowNumber As Integer
Dim i As Integer ' This is a counter through a loop
rowNumber = "=MATCH(Worksheets(2).Cells(i, "B").Value,Worksheets(3).Range("B"),0)"
I've also tried
rowNumber = Application.WorksheetFunction.Match(Worksheets(2).Cells(i, "B").Value,Worksheets(3).Range("B"),0)
and neither is working. I'm currently teaching myself VBA for Excel and I am definately struggling with the syntax.
Thanks so much!
-Tom
I am attempting to use the MATCH function to pass a cell in one worksheet as the lookup_value and a column in a second worksheet as the lookup_array. I am having trouble with the syntax and am looking for recommendations.
This is what I have:
Dim rowNumber As Integer
Dim i As Integer ' This is a counter through a loop
rowNumber = "=MATCH(Worksheets(2).Cells(i, "B").Value,Worksheets(3).Range("B"),0)"
I've also tried
rowNumber = Application.WorksheetFunction.Match(Worksheets(2).Cells(i, "B").Value,Worksheets(3).Range("B"),0)
and neither is working. I'm currently teaching myself VBA for Excel and I am definately struggling with the syntax.
Thanks so much!
-Tom