Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
naming a range
Hi
I wish to name a range using VB, the range would be the selected cells. The selected cells will vary so I cannot define e.g. A1:B4. Ideally Range (selected cells).name = my range Thanks for any help Jo |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
naming a range
This code adds a name to a cell or range of cells.
myrange=Worksheets("???").range("A1:B4") Names.Add Name:=(the name you want), RefersTo:="=(the name of your worksheet)!" & myrange (no space between my and range.) eg Names.Add Name:="rngname", RefersTo:="=sheet1!" & myrange '$a$1:$c$20" Best of luck DavidC -----Original Message----- Hi I wish to name a range using VB, the range would be the selected cells. The selected cells will vary so I cannot define e.g. A1:B4. Ideally Range (selected cells).name = my range Thanks for any help Jo . |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Naming a range | Excel Discussion (Misc queries) | |||
naming a range | Excel Programming | |||
VB Code Naming a Range (range changes each time) | Excel Programming | |||
Range naming | Excel Programming | |||
Naming a Range with VB | Excel Programming |