Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Changing Name Range based on imported data
Data is being imported and fills a variable number of rows. I start by
determining the range of cells and then assign a name with the following macro: Range("A8").Select Selection.CurrentRegion.Select ActiveWorkbook.Names.Add Name:="Input_Range", RefersToR1C1:= _ "=Sheet2r!R8C1:R92C8" The problem is I want to use this as a template and the range is set at "=Sheet2r!R8C1:R92C8" and I want it to be the area selected by the CurrentRegion function. -- Thanks, TeeSea |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Changing Name Range based on imported data
Selection.CurrentRegion.Select selection.Name="Input_Range" will do what you want and is much easier thatn using Names.Add -- Regards, Tom Ogilvy "TeeSea" wrote in message ... Data is being imported and fills a variable number of rows. I start by determining the range of cells and then assign a name with the following macro: Range("A8").Select Selection.CurrentRegion.Select ActiveWorkbook.Names.Add Name:="Input_Range", RefersToR1C1:= _ "=Sheet2r!R8C1:R92C8" The problem is I want to use this as a template and the range is set at "=Sheet2r!R8C1:R92C8" and I want it to be the area selected by the CurrentRegion function. -- Thanks, TeeSea |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Changing Name Range based on imported data
Works perfect.
-- Thanks, TeeSea "Tom Ogilvy" wrote: Selection.CurrentRegion.Select selection.Name="Input_Range" will do what you want and is much easier thatn using Names.Add -- Regards, Tom Ogilvy "TeeSea" wrote in message ... Data is being imported and fills a variable number of rows. I start by determining the range of cells and then assign a name with the following macro: Range("A8").Select Selection.CurrentRegion.Select ActiveWorkbook.Names.Add Name:="Input_Range", RefersToR1C1:= _ "=Sheet2r!R8C1:R92C8" The problem is I want to use this as a template and the range is set at "=Sheet2r!R8C1:R92C8" and I want it to be the area selected by the CurrentRegion function. -- Thanks, TeeSea |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Changing range based on Date | Excel Discussion (Misc queries) | |||
Changing numerical values based upper and lower range | Excel Discussion (Misc queries) | |||
Source Range Data changing based on drop-down menu | Charts and Charting in Excel | |||
Named Range changes when data is imported | Excel Discussion (Misc queries) | |||
New Named Range Created Each Time Data Imported into Excel via Macro | Excel Programming |