Drop Down Menu Help  
Author Message
david72





PostPosted: Mon Jul 31 12:12:49 CDT 2006 Top

Excel Programming >> Drop Down Menu Help

I have the following code copied from a previous response which is
exactly the solution I need; however, I got the run time error of
"unable to set the ListIndex property of the DropDown class" Could
anyone provide help? Thanks in advance.

Option Explicit
Sub ddMstr()

Dim dd As DropDown
Dim dd1 As DropDown

Set dd = ActiveSheet.DropDowns(Application.Caller)

With dd
If .ListIndex > 0 Then
MsgBox Range(.ListFillRange)(.ListIndex)
Set dd1 = ActiveSheet.DropDowns("drop down 2")
dd1.ListIndex = 0
dd1.ListFillRange = Worksheets("MyChoices").Range("list" _
& dd.ListIndex).Address(external:=True)
End If
End With
End Sub


Sub ddSub()
Dim dd As DropDown
Set dd = ActiveSheet.DropDowns(Application.Caller)

With dd
If .ListIndex > 0 Then
MsgBox Range(.ListFillRange)(.ListIndex)
End If
End With
End Sub

Excel405  
 
 
Bob





PostPosted: Mon Jul 31 12:12:49 CDT 2006 Top

Excel Programming >> Drop Down Menu Help Is this something I gave you?

think two statements are out of order. Try changing

dd1.ListIndex = 0
dd1.ListFillRange = Worksheets("MyChoices").Range("list" _
& dd.ListIndex).Address(external:=True)

to

dd1.ListFillRange = Worksheets("MyChoices").Range("list" _
& dd.ListIndex).Address(external:=True)
dd1.ListIndex = 0


--
HTH

Bob Phillips

(replace somewhere in email address with gmail if mailing direct)



> I have the following code copied from a previous response which is
> exactly the solution I need; however, I got the run time error of
> "unable to set the ListIndex property of the DropDown class" Could
> anyone provide help? Thanks in advance.
>
> Option Explicit
> Sub ddMstr()
>
> Dim dd As DropDown
> Dim dd1 As DropDown
>
> Set dd = ActiveSheet.DropDowns(Application.Caller)
>
> With dd
> If .ListIndex > 0 Then
> MsgBox Range(.ListFillRange)(.ListIndex)
> Set dd1 = ActiveSheet.DropDowns("drop down 2")
> dd1.ListIndex = 0
> dd1.ListFillRange = Worksheets("MyChoices").Range("list" _
> & dd.ListIndex).Address(external:=True)
> End If
> End With
> End Sub
>
>
> Sub ddSub()
> Dim dd As DropDown
> Set dd = ActiveSheet.DropDowns(Application.Caller)
>
> With dd
> If .ListIndex > 0 Then
> MsgBox Range(.ListFillRange)(.ListIndex)
> End If
> End With
> End Sub
>


 
 
Ray





PostPosted: Tue Aug 01 07:33:06 CDT 2006 Top

Excel Programming >> Drop Down Menu Help Thanks. It works perfectly now




> Is this something I gave you?
>
> think two statements are out of order. Try changing
>
> dd1.ListIndex = 0
> dd1.ListFillRange = Worksheets("MyChoices").Range("list" _
> & dd.ListIndex).Address(external:=True)
>
> to
>
> dd1.ListFillRange = Worksheets("MyChoices").Range("list" _
> & dd.ListIndex).Address(external:=True)
> dd1.ListIndex = 0
>
>
> --
> HTH
>
> Bob Phillips
>
> (replace somewhere in email address with gmail if mailing direct)
>


> > I have the following code copied from a previous response which is
> > exactly the solution I need; however, I got the run time error of
> > "unable to set the ListIndex property of the DropDown class" Could
> > anyone provide help? Thanks in advance.
> >
> > Option Explicit
> > Sub ddMstr()
> >
> > Dim dd As DropDown
> > Dim dd1 As DropDown
> >
> > Set dd = ActiveSheet.DropDowns(Application.Caller)
> >
> > With dd
> > If .ListIndex > 0 Then
> > MsgBox Range(.ListFillRange)(.ListIndex)
> > Set dd1 = ActiveSheet.DropDowns("drop down 2")
> > dd1.ListIndex = 0
> > dd1.ListFillRange = Worksheets("MyChoices").Range("list" _
> > & dd.ListIndex).Address(external:=True)
> > End If
> > End With
> > End Sub
> >
> >
> > Sub ddSub()
> > Dim dd As DropDown
> > Set dd = ActiveSheet.DropDowns(Application.Caller)
> >
> > With dd
> > If .ListIndex > 0 Then
> > MsgBox Range(.ListFillRange)(.ListIndex)
> > End If
> > End With
> > End Sub
> >

 
 
Ray





PostPosted: Tue Aug 01 10:18:19 CDT 2006 Top

Excel Programming >> Drop Down Menu Help I've spoken it too soon....

I've just discovered the vlookup function will not help displaying the
correct selection made on the 2nd drop down. I guess the solution is
to display the text on a cell and use vlookup function to match it
properly. Could anyone help me with the code required to display the
text when the selection is made in this case. Thanks in advance.





Thanks. It works perfectly now




Is this something I gave you?

think two statements are out of order. Try changing

dd1.ListIndex = 0
dd1.ListFillRange = Worksheets("MyChoices").Range("list" _
& dd.ListIndex).Address(external:=True)

to

dd1.ListFillRange = Worksheets("MyChoices").Range("list" _
& dd.ListIndex).Address(external:=True)
dd1.ListIndex = 0


--
HTH

Bob Phillips

(replace somewhere in email address with gmail if mailing direct)



I have the following code copied from a previous response which is
exactly the solution I need; however, I got the run time error of
"unable to set the ListIndex property of the DropDown class" Could
anyone provide help? Thanks in advance.

Option Explicit
Sub ddMstr()

Dim dd As DropDown
Dim dd1 As DropDown

Set dd = ActiveSheet.DropDowns(Application.Caller)

With dd
If .ListIndex 0 Then
MsgBox Range(.ListFillRange)(.ListIndex)
Set dd1 = ActiveSheet.DropDowns("drop down 2")
dd1.ListIndex = 0
dd1.ListFillRange = Worksheets("MyChoices").Range("list" _
& dd.ListIndex).Address(external:=True)
End If
End With
End Sub


Sub ddSub()
Dim dd As DropDown
Set dd = ActiveSheet.DropDowns(Application.Caller)

With dd
If .ListIndex 0 Then
MsgBox Range(.ListFillRange)(.ListIndex)
End If
End With
End Sub