Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Macros and field names
I am extracting records, as part of a macro, from a list range on the
worksheet into a data named range. At times the source table will be increased or decreased in size and when I run the macro I want it to resize the extracted name range. How do I program this within the macro? |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Macros and field names
Hi
Maybe this will help you: NameRange = Range("A1", Range("A1").End(xlDown)).Address ActiveWorkbook.Names.Add Name:="MyRangeName", RefersTo:="=Sheet1!" & NameRange Regards, Per On 3 Nov., 02:07, Joe wrote: I am extracting records, as part of a macro, from a list range on the worksheet into a data named range. *At times the source table will be increased or decreased in size and when I run the macro I want it to resize the extracted name range. *How do I program this within the macro? |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Macros and field names
Hi,
Suppose that the data is extracted to A1:D200 Range("A1").CurrentRegion.Name = "Database" This assumes there is no data that is touching your extract that is not part of the range you want to name. -- Thanks, Shane Devenshire "Joe" wrote: I am extracting records, as part of a macro, from a list range on the worksheet into a data named range. At times the source table will be increased or decreased in size and when I run the macro I want it to resize the extracted name range. How do I program this within the macro? |
#4
Posted to microsoft.public.excel.programming
|
|||
|
|||
Macros and field names
Perhaps it would be simpler to create a dynamic named range and let the
range adjust to the data size, so the code doesn't need to. http://www.contextures.com/xlNames01.html#Dynamic Mike F "Joe" wrote in message ... I am extracting records, as part of a macro, from a list range on the worksheet into a data named range. At times the source table will be increased or decreased in size and when I run the macro I want it to resize the extracted name range. How do I program this within the macro? |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Pivot Table Field Names | Excel Discussion (Misc queries) | |||
Field Names Don't Show | Excel Discussion (Misc queries) | |||
Field Names | Excel Discussion (Misc queries) | |||
field names | Excel Programming | |||
Column Words to Field Names | Excel Discussion (Misc queries) |