![]() |
Defining Range Name
Hi All,
One more problem... I am defining the range name in the column F after counting the number of data items in Column F starting from F2 (stored in Count1). I am using this code: Range("F2").Select Cells(2, "F").Resize(Count1, 1).Select ActiveWorkbook.Names.Add Name:="InitType", RefersToR1C1:="=List! R2C6:R11C6" However, looks like the refers to column is static and always naming F2:F11 range no matter what the count is...IS there any way I can include Count1 Variable in the "Refers to" part as well Thanks in advance, Anshuman |
Defining Range Name
Hi Anshuman,
If I have interpreted correctly what you are trying to do then try this and see if it works for you:- Range("F2").Select Cells(2, "F").Resize(Count1, 1).Select ActiveWorkbook.Names.Add Name:="InitType", RefersToR1C1:=Selection You can replace the range with selection because you have selected it in the previous line of code. Regards, OssieMac "anshu" wrote: Hi All, One more problem... I am defining the range name in the column F after counting the number of data items in Column F starting from F2 (stored in Count1). I am using this code: Range("F2").Select Cells(2, "F").Resize(Count1, 1).Select ActiveWorkbook.Names.Add Name:="InitType", RefersToR1C1:="=List! R2C6:R11C6" However, looks like the refers to column is static and always naming F2:F11 range no matter what the count is...IS there any way I can include Count1 Variable in the "Refers to" part as well Thanks in advance, Anshuman |
Defining Range Name
Perfect OssieMac.....Thanks a lot
On Jul 22, 1:50 pm, OssieMac wrote: Hi Anshuman, If I have interpreted correctly what you are trying to do then try this and see if it works for you:- Range("F2").Select Cells(2, "F").Resize(Count1, 1).Select ActiveWorkbook.Names.Add Name:="InitType", RefersToR1C1:=Selection You can replace the range with selection because you have selected it in the previous line of code. Regards, OssieMac "anshu" wrote: Hi All, One more problem... I am defining the range name in the column F after counting the number of data items in Column F starting from F2 (stored in Count1). I am using this code: Range("F2").Select Cells(2, "F").Resize(Count1, 1).Select ActiveWorkbook.Names.Add Name:="InitType", RefersToR1C1:="=List! R2C6:R11C6" However, looks like the refers to column is static and always naming F2:F11 range no matter what the count is...IS there any way I can include Count1 Variable in the "Refers to" part as well Thanks in advance, Anshuman |
All times are GMT +1. The time now is 12:38 PM. |
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com