Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
No Name
 
Posts: n/a
Default Yet another question naming ranges

I have workbook in which I need to import data from a text file. Every time
I import the data the number of rows change so I delete the old data before
importing the new. Now, what I want to do is select the new data and reset
the range of a named range that already exists. I can select the new range
easy enough with :

Range("R3").Select
Range(Selection, Selection.End(xlDown)).Select

After the range is selected how do I rename it? I know its something simple
but I'm stuck here and would greatly appreciate any help.

TIA

Steve H


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,080
Default Yet another question naming ranges

You don't need to select anything.

Range(Range("R3"),Range("R3").End(xlDown)).Name = "NewName"

--

Vasant

wrote in message
...
I have workbook in which I need to import data from a text file. Every

time
I import the data the number of rows change so I delete the old data

before
importing the new. Now, what I want to do is select the new data and reset
the range of a named range that already exists. I can select the new

range
easy enough with :

Range("R3").Select
Range(Selection, Selection.End(xlDown)).Select

After the range is selected how do I rename it? I know its something

simple
but I'm stuck here and would greatly appreciate any help.

TIA

Steve H




  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 510
Default Yet another question naming ranges

Hi

Maybe you try to use a dynamic named range instead

P.e. you data are in some range like A2:X### with headers in range A1:X1,
and cells in column A are never empty when there are some data in same row,
and there aren't any empty rows in used datarange.

Define named range as
YourRange=OFFSET(SheetX!$A$2,,,COUNTIF(Sheet!$A:$A ,"<")-1,24)

--
(When sending e-mail, use address )
Arvi Laanemets


wrote in message
...
I have workbook in which I need to import data from a text file. Every

time
I import the data the number of rows change so I delete the old data

before
importing the new. Now, what I want to do is select the new data and reset
the range of a named range that already exists. I can select the new

range
easy enough with :

Range("R3").Select
Range(Selection, Selection.End(xlDown)).Select

After the range is selected how do I rename it? I know its something

simple
but I'm stuck here and would greatly appreciate any help.

TIA

Steve H




  #4   Report Post  
Posted to microsoft.public.excel.programming
No Name
 
Posts: n/a
Default Yet another question naming ranges

Vasant,

Thank you very much. I knew it was something simple.

Steve

"Vasant Nanavati" <vasantn *AT* aol *DOT* com wrote in message
...
You don't need to select anything.

Range(Range("R3"),Range("R3").End(xlDown)).Name = "NewName"

--

Vasant

wrote in message
...
I have workbook in which I need to import data from a text file. Every

time
I import the data the number of rows change so I delete the old data

before
importing the new. Now, what I want to do is select the new data and

reset
the range of a named range that already exists. I can select the new

range
easy enough with :

Range("R3").Select
Range(Selection, Selection.End(xlDown)).Select

After the range is selected how do I rename it? I know its something

simple
but I'm stuck here and would greatly appreciate any help.

TIA

Steve H






  #5   Report Post  
Posted to microsoft.public.excel.programming
No Name
 
Posts: n/a
Default Yet another question naming ranges

Arvi,
Thanks for the advice. Vasant's solution fits my needs a little better.

Steve

"Arvi Laanemets" wrote in message
...
Hi

Maybe you try to use a dynamic named range instead

P.e. you data are in some range like A2:X### with headers in range A1:X1,
and cells in column A are never empty when there are some data in same

row,
and there aren't any empty rows in used datarange.

Define named range as
YourRange=OFFSET(SheetX!$A$2,,,COUNTIF(Sheet!$A:$A ,"<")-1,24)

--
(When sending e-mail, use address )
Arvi Laanemets


wrote in message
...
I have workbook in which I need to import data from a text file. Every

time
I import the data the number of rows change so I delete the old data

before
importing the new. Now, what I want to do is select the new data and

reset
the range of a named range that already exists. I can select the new

range
easy enough with :

Range("R3").Select
Range(Selection, Selection.End(xlDown)).Select

After the range is selected how do I rename it? I know its something

simple
but I'm stuck here and would greatly appreciate any help.

TIA

Steve H








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
Quick question on naming a union of ranges [email protected] Excel Discussion (Misc queries) 2 July 29th 07 11:15 AM
naming ranges Ken Wright Excel Worksheet Functions 0 November 30th 06 07:48 AM
naming ranges Gary''s Student Excel Worksheet Functions 0 November 29th 06 11:26 PM
naming ranges TechyTemp Excel Worksheet Functions 0 November 29th 06 09:18 PM
Naming Ranges Simon Shaw Excel Discussion (Misc queries) 1 February 15th 05 01:17 AM


All times are GMT +1. The time now is 04:13 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"