Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 150
Default Dependent Validation List

Hi,

A worksheet contains data as follows:

Column A ColumnnB
Country1 $B$24:$B$30
Country2 $B$9:$B$18
Country3 $B$42:$B$51
and so on

Column B has the range in another sheet where the list of States/
counties in the corresponding country are stored

When the user clicks in the corresponding cell in Column C,a dropdown
list should display the names in the range in column B and validate
that only one of those values is input.

How can this be achieved through VBA?

Thanks in advance for the Help.

Regards,
Raj



  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 811
Default Dependent Validation List

Hi Raj,

Assuming your table begins in cell A1 and your list ranges are on Sheet1
you can create a data validation list in C1 as follows:

Choose Data Validation List from the Excel menu.
In the Source box enter the formula =INDIRECT("Sheet1!" & B1)
Click OK

You can then copy this down for as many cells in column C as you need it.
Change "Sheet1" to the name of your list worksheet first and be sure to
surround the worksheet name in single quotes if it has any spaces or special
characters.

--
Rob Bovey, Excel MVP
Application Professionals
http://www.appspro.com/

* Take your Excel development skills to the next level.
* Professional Excel Development
http://www.appspro.com/Books/Books.htm

"Raj" wrote in message
...
Hi,

A worksheet contains data as follows:

Column A ColumnnB
Country1 $B$24:$B$30
Country2 $B$9:$B$18
Country3 $B$42:$B$51
and so on

Column B has the range in another sheet where the list of States/
counties in the corresponding country are stored

When the user clicks in the corresponding cell in Column C,a dropdown
list should display the names in the range in column B and validate
that only one of those values is input.

How can this be achieved through VBA?

Thanks in advance for the Help.

Regards,
Raj





  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 150
Default Dependent Validation List

Hi Bob,

Thanks,Bob. It worked.

Regards,
Raj

On May 21, 11:11*pm, "Rob Bovey" wrote:
Hi Raj,

* * Assuming your table begins in cell A1 and your list ranges are on Sheet1
you can create a data validation list in C1 as follows:

Choose Data Validation List from the Excel menu.
In the Source box enter the formula =INDIRECT("Sheet1!" & B1)
Click OK

You can then copy this down for as many cells in column C as you need it.
Change "Sheet1" to the name of your list worksheet first and be sure to
surround the worksheet name in single quotes if it has any spaces or special
characters.

--
Rob Bovey, Excel MVP
Application Professionalshttp://www.appspro.com/

* Take your Excel development skills to the next level.
* Professional Excel Developmenthttp://www.appspro.com/Books/Books.htm

"Raj" wrote in message

...

Hi,


A worksheet contains data as follows:


Column A * ColumnnB
Country1 * * * $B$24:$B$30
Country2 * * * $B$9:$B$18
Country3 * * * $B$42:$B$51
and so on


Column B has the range in another sheet where the list of States/
counties in the corresponding country are stored


When the user clicks in the corresponding cell in Column C,a dropdown
list should display the names in the range in column B and validate
that only one of those values is input.


How can this be achieved through VBA?


Thanks in advance for the Help.


Regards,
Raj


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 & Dependent Lists -from same list? blucajun Excel Worksheet Functions 5 September 26th 08 04:58 PM
Data Validation - Dependent List Prasad Gopinath Excel Discussion (Misc queries) 1 June 29th 08 10:08 PM
custom dependent list validation ben h Excel Worksheet Functions 1 October 24th 05 05:31 AM
Dependent List- Data Validation Annie Excel Worksheet Functions 2 September 23rd 05 03:40 PM
Using Validation List from Another Workbook with Dependent Data Mike R. Excel Worksheet Functions 5 January 8th 05 07:06 PM


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