Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 277
Default How do I name a range and then have that range be dynamic?

I want to select the entire contents of a worksheet, but that data set
will change each time I open it as records will be added to it every day.

I want to always choose all records, and there will never be any
non-contiguous rows in the data or blank rows in it.

So I can make a direct call to it and always get all of it by way of
the named range.
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,123
Default How do I name a range and then have that range be dynamic?

If A1 is the header for example for the first column you can use

Range("A1").CurrentRegion.Select

The same as Ctrl *

--

Regards Ron de Bruin
http://www.rondebruin.nl/tips.htm


"CellShocked" <cellshocked@thecellvalueattheendofthespreadsheet. org wrote in message
...
I want to select the entire contents of a worksheet, but that data set
will change each time I open it as records will be added to it every day.

I want to always choose all records, and there will never be any
non-contiguous rows in the data or blank rows in it.

So I can make a direct call to it and always get all of it by way of
the named range.


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 137
Default How do I name a range and then have that range be dynamic?

By selecting any cell in the range you can use
selcetion.goto.currentregion and name it using code

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,600
Default How do I name a range and then have that range be dynamic?

myName:
=OFFSET(Sheet1!$A$1,0,0,COUNTA(Sheet1!$A:$A),COUNT A(Sheet1!$1:$1))

If only for use in VBA, you say 'Select', simply
ws.Range("A1").CurrentRegion.Select

Both the above assumes your first record starts in A1

Regards,
Peter T


"CellShocked" <cellshocked@thecellvalueattheendofthespreadsheet. org wrote
in message ...
I want to select the entire contents of a worksheet, but that data set
will change each time I open it as records will be added to it every day.

I want to always choose all records, and there will never be any
non-contiguous rows in the data or blank rows in it.

So I can make a direct call to it and always get all of it by way of
the named range.



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
dynamic range based on criteria, within a dynamic range, passed to a function [email protected] Excel Programming 5 October 9th 07 10:13 PM
creating a dynamic range based on criteria, within a dynamic range, and passing it to a function [email protected] Excel Programming 0 October 9th 07 05:22 PM
getting the absolute range address from a dynamic named range junoon Excel Programming 2 March 21st 06 01:29 PM
copying dynamic range based on cell outside of range xcelelder Excel Programming 3 September 29th 05 05:08 PM
Excel 2000 VBA - Set Print Range in dynamic range sub_pop[_5_] Excel Programming 2 July 27th 04 08:01 PM


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