![]() |
#name in match
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 |
#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 |
#name in match
You may have Dimmed the name in VBA, not defined in the spreadsheet
If so, get it outside the quotes -- Kind regards, Niek Otten "Bob Phillips" wrote in message ... 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 |
#name in match
So many possible errors :-))
Bob "Niek Otten" wrote in message ... You may have Dimmed the name in VBA, not defined in the spreadsheet If so, get it outside the quotes -- Kind regards, Niek Otten "Bob Phillips" wrote in message ... 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 |
All times are GMT +1. The time now is 07:48 PM. |
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com