A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Excel » Worksheet Functions
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

List Boxes



 
 
Thread Tools Display Modes
  #1  
Old September 14th, 2004, 09:22 AM
external usenet poster
 
Posts: n/a
Default List Boxes

Hi All,

How can I make a list box that has a series of values that
are based on the values selected in another list box.

Example

List Box 1
A
B
C

List Box 2: If A is selected from List Box 1, List Box 2
will show
A1
A2
A3

or if B is selected
B1
B2
B3

or if C is selected
C1
C2
C3

this is a very simplistic example.

Thanks in Advance
  #2  
Old September 14th, 2004, 10:27 AM
mangesh_yadav
external usenet poster
 
Posts: n/a
Default

for the first listbox enter the following code

Private Sub ListBox1_Click()

If ListBox1 = "a" Then
ListBox2.ListFillRange = "f21:f22"
ElseIf ListBox1 = "b" Then
ListBox2.ListFillRange = "g21:g23"
Else
ListBox2.ListFillRange = "h21:h22"
End If

End Sub


f21:f22 range has a1 and a2
g21:f23 range has b1, b2 and b3
h21:f22 range has c1 and c2


- Mangesh


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

 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
selecting multiple records sps Using Forms 3 August 3rd, 2004 08:22 PM
Can List Boxes be used in a Report Jay Setting Up & Running Reports 1 July 16th, 2004 02:12 AM
Display Multi-Select Choices from List Boxes with and with VB code ExecutiveBest Worksheet Functions 1 July 8th, 2004 03:59 AM
synchronizing form and list box Deb Smith Using Forms 8 June 21st, 2004 08:15 PM
Radio Buttons and Dropdown List Boxes Pat Stellacci Worksheet Functions 1 October 23rd, 2003 09:26 PM


All times are GMT +1. The time now is 07:45 AM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.