Thread: #name in match
View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Bob Phillips[_6_] Bob Phillips[_6_] is offline
external usenet poster
 
Posts: 11,272
Default #name in match

That sounds like you don't really have a name called 'oneyear'. Check the
spelling of it again.

--

HTH

RP
(remove nothere from the email address if mailing direct)


wrote in message
oups.com...
I am using vba in an automation routine.
As part of this, I have a column A full of dates.
"oneyear" is defined as a date.
"numberrows" is an integer that is determined earlier to identify the
number of rows in the range. It works.
I am using match because I want the row number identified.

Range("f2").Select
ActiveCell.FormulaR1C1 = "=match(oneyear,r[-1]c[-5]:r[" & numberrows -
2 & "]c[-5],1)"

After this code runs, I get a #Name? in F2.
I am not sure why. Any ideas would be appreciated.

TIA