Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 312
Default dynamic named range

Hi. In a simple worksheet (Sheet1) there is 2 columns:
Include Name
Y Bob
Y John
N Bill
Y Tom
N Mike

How can I create a named range that will have only the Names of the people
that have a Y in the first column? And will vary when I change the contents
in the "Include" column? Thanks in advance.


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,272
Default dynamic named range

You would need to use VBA and change the range every time a cell changes as
far as I can see.

That OK?

--

HTH

RP
(remove nothere from the email address if mailing direct)


"Steph" wrote in message
...
Hi. In a simple worksheet (Sheet1) there is 2 columns:
Include Name
Y Bob
Y John
N Bill
Y Tom
N Mike

How can I create a named range that will have only the Names of the people
that have a Y in the first column? And will vary when I change the

contents
in the "Include" column? Thanks in advance.




  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,979
Default dynamic named range

Insert a column to the left of the Include column.
In the first row of data, enter the formula:
=IF(B2="Y",MAX($A$1:A1)+1,"")
Copy down to the last row of data

In another column, in row2, (cell E2, in this example), enter the formula:

=IF(ISNA(VLOOKUP(ROW()-1,$A$2:$C$25,3,FALSE)),"",VLOOKUP(ROW()-1,$A$2:$C$25,3,FALSE))

where A2:C25 is the original list of names and the new column of numbers

Copy the formula down to the last row of data in the original table

Choose InsertNameDefine
Type a name for the range, e.g. NameList
In the refers to box, enter a formula that refers to the second list:

=OFFSET(Sheet1!$E$2,0,0,MAX(Sheet1!$A:$A),1)
Click OK

Steph wrote:
Hi. In a simple worksheet (Sheet1) there is 2 columns:
Include Name
Y Bob
Y John
N Bill
Y Tom
N Mike

How can I create a named range that will have only the Names of the people
that have a Y in the first column? And will vary when I change the contents
in the "Include" column? Thanks in advance.




--
Debra Dalgleish
Excel FAQ, Tips & Book List
http://www.contextures.com/tiptech.html

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 312
Default dynamic named range

Fantastic! Thank you so much!!

"Debra Dalgleish" wrote in message
...
Insert a column to the left of the Include column.
In the first row of data, enter the formula:
=IF(B2="Y",MAX($A$1:A1)+1,"")
Copy down to the last row of data

In another column, in row2, (cell E2, in this example), enter the formula:


=IF(ISNA(VLOOKUP(ROW()-1,$A$2:$C$25,3,FALSE)),"",VLOOKUP(ROW()-1,$A$2:$C$25,
3,FALSE))

where A2:C25 is the original list of names and the new column of numbers

Copy the formula down to the last row of data in the original table

Choose InsertNameDefine
Type a name for the range, e.g. NameList
In the refers to box, enter a formula that refers to the second list:

=OFFSET(Sheet1!$E$2,0,0,MAX(Sheet1!$A:$A),1)
Click OK

Steph wrote:
Hi. In a simple worksheet (Sheet1) there is 2 columns:
Include Name
Y Bob
Y John
N Bill
Y Tom
N Mike

How can I create a named range that will have only the Names of the

people
that have a Y in the first column? And will vary when I change the

contents
in the "Include" column? Thanks in advance.




--
Debra Dalgleish
Excel FAQ, Tips & Book List
http://www.contextures.com/tiptech.html



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 named range Gadeyne Dries New Users to Excel 3 April 4th 10 05:28 AM
Dynamic Named Range dhstein Excel Discussion (Misc queries) 4 October 11th 09 11:15 PM
Dynamic Named Range [email protected] Excel Discussion (Misc queries) 0 November 20th 07 03:08 PM
Can't chart dynamic named range?? [email protected] Charts and Charting in Excel 4 July 20th 06 08:30 PM
Dynamic Named Range bountifulgrace Charts and Charting in Excel 1 April 6th 06 08:39 PM


All times are GMT +1. The time now is 09:28 PM.

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"