G
Guest
I would like to define the first and last cells of a column and tell my macro
to give me the first row that a certain value is in.
The value I'm looking to match is in cell A3493, the range I am targeting to
do the Match function is in J2 through the end of that column. I named H2 as
"picktime1". I told the macro to end x1down and named the bottom cell
"picktime2":
Dim picktime1 As Range
Dim picktime2 As Range
Range("j1").Select
Set picktime1 = ActiveCell
Selection.End(xlDown).Select
Set picktime2 = ActiveCell
I want to use range names because the length of the column I am matching to
will vary as I collect each day's data.
I tried the following, but get the "#NAME?" error message:
ActiveCell.FormulaR1C1 = "=MATCH(A3493,picktime1icktime2,0)"
Any advice?
Thanks
to give me the first row that a certain value is in.
The value I'm looking to match is in cell A3493, the range I am targeting to
do the Match function is in J2 through the end of that column. I named H2 as
"picktime1". I told the macro to end x1down and named the bottom cell
"picktime2":
Dim picktime1 As Range
Dim picktime2 As Range
Range("j1").Select
Set picktime1 = ActiveCell
Selection.End(xlDown).Select
Set picktime2 = ActiveCell
I want to use range names because the length of the column I am matching to
will vary as I collect each day's data.
I tried the following, but get the "#NAME?" error message:
ActiveCell.FormulaR1C1 = "=MATCH(A3493,picktime1icktime2,0)"
Any advice?
Thanks