Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 23
Default Populating a Data Validation List

I need to include a list-driven data validation in a large number of cells,
which are all consecutive in a column. The items to populate the list reside
in both column B and column C on the same sheet. In any given row of the
range in which the items reside, column B or column C will be non-blank, but
not both. The way that I have been populating the list is to populate a
named range on another sheet (call it Sheet 2) by using whichever cell in a
given row has something in it, e.g.,

=IF(ISNUMBER('Sheet 1!B9),'Sheet 1!C9,'Sheet 1'!B9)

My boss doesn't like this idea, because there's the possibility that he will
add a row in the middle of the range on Sheet 1. I can get around this by
writing a macro to run when the worksheet opens to reconstruct the range on
Sheet 2 so that it will reference all rows in the range on Sheet 1, but that
won't address changes made during a session.

Is there a clever way to use a formula in the list definition for a Data
Validation to populate the list directly from the range in, say, B9 to C30,
using whichever column in a row happens to have something in it?
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 611
Default Populating a Data Validation List

Jim,

I'm not sure what you mean by "reconstruct the range on Sheet 2," but if it builds your
formula in the inserted row(s) of Sheet 1, then perhaps you could have it run whenever a
change is made to the sheet, rather than just when the workbook is opened. In the Sheet
module for the Sheet 1, use the Worksheet_Change event:

Private Sub Worksheet_Change(ByVal Target As Range)
' your code here
End Sub

The routine will run whenever any change is made to the sheet, but the overhead won't likely
be noticeable. If it is, we'll find a way to have it run on a more selective basis.
--
Regards from Virginia Beach,

Earl Kiosterud
www.smokeylake.com

Note: Top-posting has been the norm here.
Some folks prefer bottom-posting.
But if you bottom-post to a reply that's
already top-posted, the thread gets messy.
When in Rome...
-----------------------------------------------------------------------
"Jim Skrydlak" wrote in message
...
I need to include a list-driven data validation in a large number of cells,
which are all consecutive in a column. The items to populate the list reside
in both column B and column C on the same sheet. In any given row of the
range in which the items reside, column B or column C will be non-blank, but
not both. The way that I have been populating the list is to populate a
named range on another sheet (call it Sheet 2) by using whichever cell in a
given row has something in it, e.g.,

=IF(ISNUMBER('Sheet 1!B9),'Sheet 1!C9,'Sheet 1'!B9)

My boss doesn't like this idea, because there's the possibility that he will
add a row in the middle of the range on Sheet 1. I can get around this by
writing a macro to run when the worksheet opens to reconstruct the range on
Sheet 2 so that it will reference all rows in the range on Sheet 1, but that
won't address changes made during a session.

Is there a clever way to use a formula in the list definition for a Data
Validation to populate the list directly from the range in, say, B9 to C30,
using whichever column in a row happens to have something in it?



  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 23
Default Populating a Data Validation List

That will do it. I'd forgotten about the Worksheet Change event. Thank you
for reminding me!

Jim

"Earl Kiosterud" wrote:

Jim,

I'm not sure what you mean by "reconstruct the range on Sheet 2," but if it builds your
formula in the inserted row(s) of Sheet 1, then perhaps you could have it run whenever a
change is made to the sheet, rather than just when the workbook is opened. In the Sheet
module for the Sheet 1, use the Worksheet_Change event:

Private Sub Worksheet_Change(ByVal Target As Range)
' your code here
End Sub

The routine will run whenever any change is made to the sheet, but the overhead won't likely
be noticeable. If it is, we'll find a way to have it run on a more selective basis.
--
Regards from Virginia Beach,

Earl Kiosterud
www.smokeylake.com

Note: Top-posting has been the norm here.
Some folks prefer bottom-posting.
But if you bottom-post to a reply that's
already top-posted, the thread gets messy.
When in Rome...
-----------------------------------------------------------------------
"Jim Skrydlak" wrote in message
...
I need to include a list-driven data validation in a large number of cells,
which are all consecutive in a column. The items to populate the list reside
in both column B and column C on the same sheet. In any given row of the
range in which the items reside, column B or column C will be non-blank, but
not both. The way that I have been populating the list is to populate a
named range on another sheet (call it Sheet 2) by using whichever cell in a
given row has something in it, e.g.,

=IF(ISNUMBER('Sheet 1!B9),'Sheet 1!C9,'Sheet 1'!B9)

My boss doesn't like this idea, because there's the possibility that he will
add a row in the middle of the range on Sheet 1. I can get around this by
writing a macro to run when the worksheet opens to reconstruct the range on
Sheet 2 so that it will reference all rows in the range on Sheet 1, but that
won't address changes made during a session.

Is there a clever way to use a formula in the list definition for a Data
Validation to populate the list directly from the range in, say, B9 to C30,
using whichever column in a row happens to have something in it?




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
data validation list: how do i 'force' a user to enter data from the list? showsomeidnow Excel Discussion (Misc queries) 4 May 1st 07 05:49 PM
data validation list: how do i 'force' a user to enter data from the list? showsomeidnow Excel Discussion (Misc queries) 2 April 29th 07 11:09 PM
data validation invalid in dynamic validation list ilia Excel Discussion (Misc queries) 0 November 7th 06 12:54 PM
data validation invalid in dynamic validation list ilia Excel Worksheet Functions 0 November 7th 06 12:54 PM
Data Validation - List - keeping the format of the list - shading aasbury Excel Discussion (Misc queries) 1 June 5th 06 04:25 PM


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