![]() |
![]() |
|
|||||||
| Excel Questions All Excel/VBA questions - formulas, macros, pivot tables, general help, etc. Please post to this forum in English only. |
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
MrExcel MVP
Join Date: Feb 2002
Location: Christchurch New Zealand
Posts: 1,030
|
Anyone have any code for changing a named range
eg StartCell and if possible refering it to a variable? |
|
|
|
|
|
#2 |
|
Board Regular
Join Date: Mar 2002
Location: Cincinnati, Ohio, USA
Posts: 6,824
|
This may or may not help you.
The code names a range based upon the cell contents. Maybe you can pickup on the syntax. I do not know if this is the easiest way to name a range, it's just the first way I found that works. Tom See last post, toward the end if the procedure. http://www.mrexcel.com/board/viewtop...c=7082&forum=2 |
|
|
|
|
|
#3 |
|
MrExcel MVP
Join Date: Feb 2002
Location: Christchurch New Zealand
Posts: 1,030
|
yeah no I was just after code to rename a current named range I have any Ideas?
|
|
|
|
|
|
#4 |
|
Board Regular
Join Date: Mar 2002
Location: Cincinnati, Ohio, USA
Posts: 6,824
|
Sorry, I misunderstood you.
This will rename a current named range... ActiveWorkbook.Names("YourRangeName").Name = "NewRangeName" Tom |
|
|
|
|
|
#5 | |
|
MrExcel MVP
Join Date: Feb 2002
Location: Auckland, New Zealand
Posts: 4,209
|
Quote:
Try something like this; Sub ReName_NamedRg() With ActiveWorkbook 'add named range .Names.Add Name:="Test", RefersTo:="=" & ActiveSheet.Name & "!$A$1:$A$10" End With End Sub Tom bet me to it! _________________ Kind Regards, Ivan F Moala [ This Message was edited by: Ivan F Moala on 2002-05-14 19:26 ] |
|
|
|
|
|
|
#6 |
|
MrExcel MVP
Join Date: Feb 2002
Location: Christchurch New Zealand
Posts: 1,030
|
Thanks Tom
|
|
|
|
|
|
#7 |
|
Board Regular
Join Date: Mar 2002
Location: Cincinnati, Ohio, USA
Posts: 6,824
|
'Tis rare Ivan!
|
|
|
|
|
|
#8 |
|
MrExcel MVP
Join Date: Feb 2002
Location: Christchurch New Zealand
Posts: 1,030
|
Thanks Guys
|
|
|
|
![]() |
| Bookmarks |
| Thread Tools | |
| Display Modes | |
|
|