Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Drop Down Lists with "variable" ranges?

Hello All,

I need to define the range of a drop down list in some dynamic way.
am adding rows to the top of the range and I need to redefine the rang
whenever a new row is added. I tried simply playing with absolute v
relative refs, but it seems to redefine itself when I use the list (n
idea why). Regardless, I'd rather do it all in code so I can be sur
of what is happening.

I can use the following code to redefine my named range:

ActiveWorkbook.Names("range_name").RefersTo =
"='Sheet Name'!$B$4:$B$6"

But, I need to make the new range a variable so that it covers B4:B
after one row is added, and B4:B8 after the second row is added and s
forth. Basically, it needs to begin at B4 and extend to include ever
cell below that contains a value.

Thanks!

--
Message posted from http://www.ExcelForum.com

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,123
Default Drop Down Lists with "variable" ranges?

Hi William

Look at Debra's page for Dynamic range
http://www.contextures.com/xlNames01.html


--
Regards Ron de Bruin
http://www.rondebruin.nl


"William DeLeo " wrote in message ...
Hello All,

I need to define the range of a drop down list in some dynamic way. I
am adding rows to the top of the range and I need to redefine the range
whenever a new row is added. I tried simply playing with absolute vs
relative refs, but it seems to redefine itself when I use the list (no
idea why). Regardless, I'd rather do it all in code so I can be sure
of what is happening.

I can use the following code to redefine my named range:

ActiveWorkbook.Names("range_name").RefersTo =
"='Sheet Name'!$B$4:$B$6"

But, I need to make the new range a variable so that it covers B4:B7
after one row is added, and B4:B8 after the second row is added and so
forth. Basically, it needs to begin at B4 and extend to include every
cell below that contains a value.

Thanks!!


---
Message posted from http://www.ExcelForum.com/



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Drop Down Lists with "variable" ranges?

There's a complete answer for ya ... thanks so much (again)

--
Message posted from http://www.ExcelForum.com

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
repost of question from 2/4 "Using drop-down lists" RoofIL Excel Worksheet Functions 2 February 5th 10 10:34 PM
How do I use "sumif" for cells "0" across multiple ranges? PKB Excel Discussion (Misc queries) 2 July 14th 09 01:05 PM
how can I disable "cutting cells" and "drag and drop "in excel ? mwoody Excel Worksheet Functions 4 August 25th 08 03:53 PM
Excel - Golf - how to display "-2" as "2 Under" or "4"as "+4" or "4 Over" in a calculation cell Steve Kay Excel Discussion (Misc queries) 2 August 8th 08 01:54 AM
"Type mismatch" when I try to fill an Array variable with "+" [email protected] Excel Discussion (Misc queries) 1 April 17th 07 01:28 PM


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