Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 10
Default auto add rows to ranges

is there any way when i insert a row to have it join a range? I want to
define one row as a range and then any rows i insert on top of it to be
added to that range automatically. Nay ideas? Thanks for any help.

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default auto add rows to ranges

Use a defined name as the definition of the range

Insert = Name = Define

Name: List
RefersTo: =Offset(Sheet1!$A$1,0,0,CountA(Sheet1!$A:$A),10)

change 10 to reflect the number of columns.

Then in you code you can use

set rng = Range("list")

or as advised before


set rng = Range("A1").CurrentRegion

would do the same.

--
Regards,
Tom Ogilvy

wrote in message
oups.com...
is there any way when i insert a row to have it join a range? I want to
define one row as a range and then any rows i insert on top of it to be
added to that range automatically. Nay ideas? Thanks for any help.



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,560
Default auto add rows to ranges

Hi,
This is a non VB, low tech solution and it does not not work, if the named
range includes Row 1. Include the row above what you want in the named range
and when you insert a row, it will automatically be included. Example,
desired named range is B3-B5, the relavant range, but when you establish the
range make it B2-B5. When you insert a row at B3, it will be included in the
existing named range.

" wrote:

is there any way when i insert a row to have it join a range? I want to
define one row as a range and then any rows i insert on top of it to be
added to that range automatically. Nay ideas? Thanks for any help.


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
Auto set data ranges LiAD Charts and Charting in Excel 2 January 13th 09 08:47 AM
Auto Number the Rows of Auto Filter Result ashish128 Excel Discussion (Misc queries) 3 April 29th 07 06:41 PM
How to create ranges with auto filter Ivy Chua Excel Programming 1 October 25th 04 06:42 PM
VBA Auto selecting and calculating ranges arunsharm82 Excel Programming 0 January 22nd 04 01:57 PM


All times are GMT +1. The time now is 02:54 AM.

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

About Us

"It's about Microsoft Excel"