LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #4   Report Post  
Mangesh Yadav
 
Posts: n/a
Default

Thats a nice one.

Mangesh


"Pank" wrote in message
...
Vikas,

Look at http://www.contextures.com/xlDataVal02.html

Pank

"mangesh_yadav" wrote:


Suppose you want to have your products in column A, and the options in
B. Start with a defined list in say column M for products, O for
options for product 1, P for product2 and so on. Keep N empty.

Now, go to column A, Data Validation. Select List and add source as
the list from column M. For column B, add source as list from column N
(which is still empty).

Now the object is, depending on the selection is column A, you need to
fill the column N with its respective options. For this use the
Worksheet_SelectionChange event, somthing like this.

Private Sub Worksheet_SelectionChange(ByVal Target As Range)

Set rngN = Range("N1:N2")
Set rngO = Range("O1:O2")
Set rngP = Range("P1:P2")

If Cells(1, Target.Row) = "p1" Then
Call myRng(rngN, rngO)
Else
Call myRng(rngN, rngP)
End If

End Sub

Sub myRng(tRng, sRng)
For i = 1 To tRng.Rows.Count
tRng(i) = sRng(i)
Next i
End Sub

The above code goes in the module of the sheet where you have your
lists. Right click on the sheetname, select view code and enter the
above code.

Mangesh


--
mangesh_yadav
------------------------------------------------------------------------
mangesh_yadav's Profile:

http://www.excelforum.com/member.php...o&userid=10470
View this thread:

http://www.excelforum.com/showthread...hreadid=381501




 
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
changing value of a cell by selecting an item from a drop down list Bobby Mir Excel Worksheet Functions 6 June 8th 05 08:33 PM
Using symbols for drop down list boxes? Sumeet Benawra Excel Worksheet Functions 0 April 19th 05 11:41 AM
Pull unique names for drop down list [email protected] Excel Discussion (Misc queries) 3 February 1st 05 10:23 PM
automatic color change in cells using a drop down list kennethwt Excel Worksheet Functions 1 January 21st 05 06:37 PM
Drop List Referencing Boony Excel Worksheet Functions 2 November 11th 04 11:42 AM


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