JannetteChristie
Board Regular
- Joined
- Dec 14, 2015
- Messages
- 130
- Office Version
- 365
Hello,
I am having trouble converting the following excel function to vba:
=INDEX('Product Selector'!F13:F18,MATCH(Specify!B10,'Product Selector'!A13:A18,0),1)
The vba code I have is as follows:
iRowNo = 10
For i = 1 To lr
x = Application.WorksheetFunction.Index(Sheets("Product Selector").Range("A13:A100") _
, Application.WorksheetFunction.Match(Sheets("Specify").Cells(iRowNo, 2), Sheets("Product Selector").Range("F3:F100"), 0), 1)
If Not (IsError(x)) Then
Worksheets("Specify").Cells(iRowNo, 4).Value = x
End If
iRowNo = iRowNo + 1
Next i
I keep getting a run-time error '1004'
I am having trouble converting the following excel function to vba:
=INDEX('Product Selector'!F13:F18,MATCH(Specify!B10,'Product Selector'!A13:A18,0),1)
The vba code I have is as follows:
iRowNo = 10
For i = 1 To lr
x = Application.WorksheetFunction.Index(Sheets("Product Selector").Range("A13:A100") _
, Application.WorksheetFunction.Match(Sheets("Specify").Cells(iRowNo, 2), Sheets("Product Selector").Range("F3:F100"), 0), 1)
If Not (IsError(x)) Then
Worksheets("Specify").Cells(iRowNo, 4).Value = x
End If
iRowNo = iRowNo + 1
Next i
I keep getting a run-time error '1004'