Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
how to give variable range
i need the code for doing this..please help
i= 2 to 20 (variable) ActiveWorkbook.Names.Add Name:="abc", RefersTorange= cells(1,1),cells(i,1) |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
how to give variable range
i = 5
Set myrange = Range("A1", Cells(1, i)) ActiveWorkbook.Names.Add Name:="abc", RefersTo:="=" & myrange.Address "ezil" wrote: i need the code for doing this..please help i= 2 to 20 (variable) ActiveWorkbook.Names.Add Name:="abc", RefersTorange= cells(1,1),cells(i,1) |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
how to give variable range
Better to use an offset formula such as =offset($a$1,0,0,counta($a:$a)) but
to answer. Sub namerng() mc = "b" lr = cells(Rows.Count, mc).End(xlUp).Row Range(cells(1, mc), cells(lr, mc)).Name = "abc" End Sub -- Don Guillett Microsoft MVP Excel SalesAid Software "ezil" wrote in message ... i need the code for doing this..please help i= 2 to 20 (variable) ActiveWorkbook.Names.Add Name:="abc", RefersTorange= cells(1,1),cells(i,1) |
#4
Posted to microsoft.public.excel.programming
|
|||
|
|||
how to give variable range
Range("A2").Resize(i - 1).Name = "abc" -- __________________________________ HTH Bob "ezil" wrote in message ... i need the code for doing this..please help i= 2 to 20 (variable) ActiveWorkbook.Names.Add Name:="abc", RefersTorange= cells(1,1),cells(i,1) |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
How to give values to a range? | Excel Discussion (Misc queries) | |||
How to give a value to a range of data? | Excel Discussion (Misc queries) | |||
Give a cell a name that is variable | Excel Worksheet Functions | |||
automatic range - named range give me circular reference... | Excel Discussion (Misc queries) | |||
Is there any way to give an dynamic name for a range? | Excel Discussion (Misc queries) |