Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.misc
|
|||
|
|||
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 |
#2
Posted to microsoft.public.excel.misc
|
|||
|
|||
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 |
#3
Posted to microsoft.public.excel.misc
|
|||
|
|||
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 |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
help defining dynamic range | Charts and Charting in Excel | |||
Defining Range within Specific Dates | Excel Worksheet Functions | |||
Defining a range using a cell reference | Excel Worksheet Functions | |||
Drop down defining content of a range of cells | Links and Linking in Excel | |||
Defining a range | Excel Worksheet Functions |