Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3
Default 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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Changing range based on Date KeyloPapa Excel Discussion (Misc queries) 5 October 3rd 09 04:59 PM
Changing numerical values based upper and lower range jrmcosmo Excel Discussion (Misc queries) 4 September 22nd 09 04:58 PM
Source Range Data changing based on drop-down menu [email protected] Charts and Charting in Excel 3 March 9th 08 06:19 PM
Named Range changes when data is imported Matt7102 Excel Discussion (Misc queries) 1 August 28th 06 10:03 PM
New Named Range Created Each Time Data Imported into Excel via Macro Carroll Rinehart Excel Programming 2 October 28th 04 04:33 PM


All times are GMT +1. The time now is 05:30 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"