L
L. Howard
In the code, trying to assign the row number this formula returns to i.
=LOOKUP(2,1/(A1:A20="abc"),ROW(A1:A20)) = 15 (on the sheet Array Enter)
Errors out with "OneRng" in this line highlighted in blue (OneRng = "abc")
Code compiles, but with "expanded" spaces?? Then errors when run.
Sub SomeRangeA()
Dim OneRng As Range
Dim i As Long, ii As Long
Set OneRng = Range("A1:A" & Cells(Rows.Count, "A").End(xlUp).Row)
i = Application.WorksheetFunction.Lookup(2, 1 / (OneRng = "abc"), Row(OneRng))
End Sub
Thanks,
Howard
=LOOKUP(2,1/(A1:A20="abc"),ROW(A1:A20)) = 15 (on the sheet Array Enter)
Errors out with "OneRng" in this line highlighted in blue (OneRng = "abc")
Code compiles, but with "expanded" spaces?? Then errors when run.
Sub SomeRangeA()
Dim OneRng As Range
Dim i As Long, ii As Long
Set OneRng = Range("A1:A" & Cells(Rows.Count, "A").End(xlUp).Row)
i = Application.WorksheetFunction.Lookup(2, 1 / (OneRng = "abc"), Row(OneRng))
End Sub
Thanks,
Howard