MrExcel Publishing
Your One Stop for Excel Tips & Solutions

RowSource Property

Posted by Fred on October 04, 2001 2:46 PM

I'm using the following statement in an initialize routine to define a name(cells1) for a group of cells(A1-A13).

ActiveWorkbook.Names.Add Name="cells1", RefersToR1C1:="Sheet1!R1C1:R13C1"

My question is how do I define the name for a variable amount of cells ? I can find "lastrow" but using 'Rlastrow' in the statement above does not work.
Any suggestions ? .... Thanks

Posted by Anon on October 04, 2001 3:14 PM

ActiveWorkbook.Names.Add Name:="cells1", RefersToR1C1:="Sheet1!R1C1:R" & Rlastrow & "C1"