Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Refers to active cells
I have this line of code is there a way to change the RefersTo section to
ReferTo the active cells? ActiveWorkbook.Names.Add Name:="OBM", RefersToR1C1:="=Densities!R4C6:R139C6" Thank you |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Refers to active cells
Hi
This should do it: MyList = Selection.Address ActiveWorkbook.Names.Add Name:="OBM", RefersTo:="=Densities!" & MyList Regards, Per "Miree" skrev i meddelelsen ... I have this line of code is there a way to change the RefersTo section to ReferTo the active cells? ActiveWorkbook.Names.Add Name:="OBM", RefersToR1C1:="=Densities!R4C6:R139C6" Thank you |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Refers to active cells
Hi
The answer is Yes: ActiveWorkbook.Names.Add Name:="OBM", RefersToR1C1:=Selection.Address But I would be careful about that. HTH Cordially Pascal "Miree" a écrit dans le message de news: ... I have this line of code is there a way to change the RefersTo section to ReferTo the active cells? ActiveWorkbook.Names.Add Name:="OBM", RefersToR1C1:="=Densities!R4C6:R139C6" Thank you |
#4
Posted to microsoft.public.excel.programming
|
|||
|
|||
Refers to active cells
Since active cells could be from another sheet:
shname = ActiveSheet.Name & "!" ActiveWorkbook.Names.Add Name:="OBM", RefersToR1C1:=shname & Selection.Address But I still think this is a little dangerous. HTH Cordially Pascal "papou" a écrit dans le message de news: ... Hi The answer is Yes: ActiveWorkbook.Names.Add Name:="OBM", RefersToR1C1:=Selection.Address But I would be careful about that. HTH Cordially Pascal "Miree" a écrit dans le message de news: ... I have this line of code is there a way to change the RefersTo section to ReferTo the active cells? ActiveWorkbook.Names.Add Name:="OBM", RefersToR1C1:="=Densities!R4C6:R139C6" Thank you |
#5
Posted to microsoft.public.excel.programming
|
|||
|
|||
Refers to active cells
This worked well, but came accross a problem, one of the ranges i need
defined is a combination of two ranges WBM and OBM, is there a way to make both named ranges active and to name? Thank you "papou" wrote: Hi The answer is Yes: ActiveWorkbook.Names.Add Name:="OBM", RefersToR1C1:=Selection.Address But I would be careful about that. HTH Cordially Pascal "Miree" a écrit dans le message de news: ... I have this line of code is there a way to change the RefersTo section to ReferTo the active cells? ActiveWorkbook.Names.Add Name:="OBM", RefersToR1C1:="=Densities!R4C6:R139C6" Thank you |
#7
Posted to microsoft.public.excel.programming
|
|||
|
|||
Refers to active cells
That doesn't work when you need to select two named ranges, but i have
decided i dont need it anymore anyways but thatnks for all the advice "papou" wrote: Miree To select multiple ranges, hold the CTRL key. Cordially Pascal "Miree" a écrit dans le message de news: ... This worked well, but came accross a problem, one of the ranges i need defined is a combination of two ranges WBM and OBM, is there a way to make both named ranges active and to name? Thank you "papou" wrote: Hi The answer is Yes: ActiveWorkbook.Names.Add Name:="OBM", RefersToR1C1:=Selection.Address But I would be careful about that. HTH Cordially Pascal "Miree" a écrit dans le message de news: ... I have this line of code is there a way to change the RefersTo section to ReferTo the active cells? ActiveWorkbook.Names.Add Name:="OBM", RefersToR1C1:="=Densities!R4C6:R139C6" Thank you |
#8
Posted to microsoft.public.excel.programming
|
|||
|
|||
Refers to active cells
Another:
with selection .name = "'" & .parent.name & "'!" & "OBM" end with Ps. I wouldn't use this name. If you ever upgrade to xl2007 (with 16k columns), this will be an invalid name--it looks too much like a column reference. I'd use "_OBM" Miree wrote: I have this line of code is there a way to change the RefersTo section to ReferTo the active cells? ActiveWorkbook.Names.Add Name:="OBM", RefersToR1C1:="=Densities!R4C6:R139C6" Thank you -- Dave Peterson |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Formula refers to empty cells even when cells contains data | Excel Worksheet Functions | |||
Data Valid - refers to the values of 2 cells | New Users to Excel | |||
Conditional format refers to two cells | Excel Worksheet Functions | |||
Where is the Data Tools group Help refers to when splitting cells | Excel Worksheet Functions | |||
Macro execution refers not to the active sheet/excel file | Excel Programming |