Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default 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

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 10,593
Default 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)

"Ray" wrote in message
ups.com...
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



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3
Default Drop Down Menu Help

Thanks. It works perfectly now



Bob Phillips wrote:
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)

"Ray" wrote in message
ups.com...
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


  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3
Default 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.




Ray :-) wrote:
Thanks. It works perfectly now



Bob Phillips wrote:
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)

"Ray" in message
ups.com...
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

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
Drop Down choice needs to lead to another drop down menu Hudson Excel Discussion (Misc queries) 1 January 9th 09 12:36 AM
DROP DOWN MENU DOES NOT APPEAR Loisw Excel Discussion (Misc queries) 4 November 10th 08 06:29 AM
Drop dwn menu. Formula to count selection frm menu in anoth cell? ggoldber Excel Worksheet Functions 1 June 4th 08 02:21 PM
filter dropdown menu so 2nd drop menu is customized menugal Excel Worksheet Functions 1 September 4th 07 05:25 PM
Cross-referenced drop-down menu (nested drop-downs?) creativeops Excel Worksheet Functions 4 November 22nd 05 05:41 PM


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