Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Create a Named Range in Excel with VBA
Hello Group:
I am attempting to create a named range in Excel by using a VBA macro. I have a table of information where the number of rows is variable. I need to create a hard coded range name by running a macro which will change as the number of rows changes. I attempted to record keystrokes, but am not getting the correct result. Does anyone have any code they could share in this case? thx Bill |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Create a Named Range in Excel with VBA
Hi
see: http://www.xldynamic.com/source/xld.Names.html -- Regards Frank Kabel Frankfurt, Germany "GoKingBee" schrieb im Newsbeitrag ... Hello Group: I am attempting to create a named range in Excel by using a VBA macro. I have a table of information where the number of rows is variable. I need to create a hard coded range name by running a macro which will change as the number of rows changes. I attempted to record keystrokes, but am not getting the correct result. Does anyone have any code they could share in this case? thx Bill |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Create a Named Range in Excel with VBA
If your table already has a range name (in my example "mytable"), then try
this piece of code range("mytable").currentregion.name="mytable" If the range doesn't exist yet, you need to add statements to set the active cell to one within the range of interest, then continue with this code: activecell.currentregion.name="mytable" Substitue your named range as needed. Rick Ward "GoKingBee" wrote: Hello Group: I am attempting to create a named range in Excel by using a VBA macro. I have a table of information where the number of rows is variable. I need to create a hard coded range name by running a macro which will change as the number of rows changes. I attempted to record keystrokes, but am not getting the correct result. Does anyone have any code they could share in this case? thx Bill |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
How to create a dynamic named range? | Excel Discussion (Misc queries) | |||
#value! error trying to create a simple dynamic named range | Excel Discussion (Misc queries) | |||
how do i create a named range excluding particular cells | Excel Discussion (Misc queries) | |||
Using a formula to create named range reference | Excel Worksheet Functions | |||
Create named range | Excel Programming |