Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 115
Default Select case for dependant lists

A few days ago I posted a question on dependant lists using combo boxes from
the FORMS toolbar. It appears as though I will have to use the combo box from
the control toolbox because as hard as I try I cant seem to get the FORMS
combo box to work. FSt1 did his/her best to help me and suggested it might be
worth using a select case. I have never heard of this before so I would be
grateful for some help using this function. What I have is a survey that
includes 2 drop down lists in combo boxes. The first list has approximately
10 categories and in the second list there are about 10-15 sub categories per
category. I want people to be able to choose a category from the first list
and then the second list will bring up the appropriate sub categories. I
would appreciate any assistance as this is driving me insane.
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 35,218
Default Select case for dependant lists

I put a couple of dropdowns from the Forms toolbar on Sheet1.

They were called "Drop down 1" and "drop down 2". DD1 controls DD2.

DD1 had a list with 3 options--I set that input range manually.

I created 3 ranges on Sheet2.
A_Range
B_Range
C_Range

Then I assigned this macro to DD1:

Option Explicit
Sub DD1Change()
Dim DD1 As DropDown
Dim DD2 As DropDown
Dim myRng As Range

Set DD1 = ActiveSheet.DropDowns("Drop down 1")
Set DD2 = ActiveSheet.DropDowns("Drop down 2")

With DD1
Set myRng = Nothing
Select Case .ListIndex
Case Is = 1: Set myRng = Worksheets("sheet2").Range("A_Range")
Case Is = 2: Set myRng = Worksheets("sheet2").Range("b_Range")
Case Is = 3: Set myRng = Worksheets("sheet2").Range("c_Range")
End Select
End With

If myRng Is Nothing Then
MsgBox "Design error!!!!"
Else
DD2.ListFillRange = myRng.Address(external:=True)
DD2.ListIndex = 0
End If

End Sub

Lynda wrote:

A few days ago I posted a question on dependant lists using combo boxes from
the FORMS toolbar. It appears as though I will have to use the combo box from
the control toolbox because as hard as I try I cant seem to get the FORMS
combo box to work. FSt1 did his/her best to help me and suggested it might be
worth using a select case. I have never heard of this before so I would be
grateful for some help using this function. What I have is a survey that
includes 2 drop down lists in combo boxes. The first list has approximately
10 categories and in the second list there are about 10-15 sub categories per
category. I want people to be able to choose a category from the first list
and then the second list will bring up the appropriate sub categories. I
would appreciate any assistance as this is driving me insane.


--

Dave Peterson
  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 115
Default Select case for dependant lists

Dave, Thank you, thank you, thank you, you are a legend.

Cheers

"Dave Peterson" wrote:

I put a couple of dropdowns from the Forms toolbar on Sheet1.

They were called "Drop down 1" and "drop down 2". DD1 controls DD2.

DD1 had a list with 3 options--I set that input range manually.

I created 3 ranges on Sheet2.
A_Range
B_Range
C_Range

Then I assigned this macro to DD1:

Option Explicit
Sub DD1Change()
Dim DD1 As DropDown
Dim DD2 As DropDown
Dim myRng As Range

Set DD1 = ActiveSheet.DropDowns("Drop down 1")
Set DD2 = ActiveSheet.DropDowns("Drop down 2")

With DD1
Set myRng = Nothing
Select Case .ListIndex
Case Is = 1: Set myRng = Worksheets("sheet2").Range("A_Range")
Case Is = 2: Set myRng = Worksheets("sheet2").Range("b_Range")
Case Is = 3: Set myRng = Worksheets("sheet2").Range("c_Range")
End Select
End With

If myRng Is Nothing Then
MsgBox "Design error!!!!"
Else
DD2.ListFillRange = myRng.Address(external:=True)
DD2.ListIndex = 0
End If

End Sub

Lynda wrote:

A few days ago I posted a question on dependant lists using combo boxes from
the FORMS toolbar. It appears as though I will have to use the combo box from
the control toolbox because as hard as I try I canĂ¢‚¬„¢t seem to get the FORMS
combo box to work. FSt1 did his/her best to help me and suggested it might be
worth using a select case. I have never heard of this before so I would be
grateful for some help using this function. What I have is a survey that
includes 2 drop down lists in combo boxes. The first list has approximately
10 categories and in the second list there are about 10-15 sub categories per
category. I want people to be able to choose a category from the first list
and then the second list will bring up the appropriate sub categories. I
would appreciate any assistance as this is driving me insane.


--

Dave Peterson

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
Case without Select Case error problem Ayo Excel Discussion (Misc queries) 2 May 16th 08 03:48 PM
Dependant lists help needed Dando265 Excel Discussion (Misc queries) 16 June 12th 07 09:10 AM
Dependant Lists Question ALEX Excel Worksheet Functions 5 February 6th 07 03:23 PM
3 way dependant lists stratmyster Excel Worksheet Functions 3 July 24th 06 05:21 PM
Dependant Lists Steve Bladon Excel Discussion (Misc queries) 2 June 13th 05 12:28 PM


All times are GMT +1. The time now is 11:36 PM.

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"