Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I have created a list box on a worksheet and can set its
properties in VBA as follows: ActiveSheet.Shapes("ListBox1").ControlFormat.ListF illRange = "B5:B8" ActiveSheet.Shapes("ListBox1").ControlFormat.Multi Select = xlExtended How do I determine the list items that have been selected? The .Selected(index) (boolean) property is not a property of the ControlFormat object. TIA P Taylor |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Here is some code as a starter
With Me.ListBox1 For i = 0 To .ListCount - 1 If .Selected(i) Then Msgbox .List(i) End If Next i End With -- HTH RP (remove nothere from the email address if mailing direct) "ptaylor" wrote in message ... I have created a list box on a worksheet and can set its properties in VBA as follows: ActiveSheet.Shapes("ListBox1").ControlFormat.ListF illRange = "B5:B8" ActiveSheet.Shapes("ListBox1").ControlFormat.Multi Select = xlExtended How do I determine the list items that have been selected? The .Selected(index) (boolean) property is not a property of the ControlFormat object. TIA P Taylor |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Bob,
I can't get it to recognize ListBox1. I get a "Method or data member not found (Error 461)". Also, it looks like a I need a class module in order to use the Me object. Thanks ptaylor -----Original Message----- Here is some code as a starter With Me.ListBox1 For i = 0 To .ListCount - 1 If .Selected(i) Then Msgbox .List(i) End If Next i End With -- HTH RP (remove nothere from the email address if mailing direct) "ptaylor" wrote in message ... I have created a list box on a worksheet and can set its properties in VBA as follows: ActiveSheet.Shapes ("ListBox1").ControlFormat.ListFillRange = "B5:B8" ActiveSheet.Shapes ("ListBox1").ControlFormat.MultiSelect = xlExtended How do I determine the list items that have been selected? The .Selected(index) (boolean) property is not a property of the ControlFormat object. TIA P Taylor . |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Sorry, I gave you code for a Forms listbox. How did you create it?
-- HTH RP (remove nothere from the email address if mailing direct) "ptaylor" wrote in message ... Bob, I can't get it to recognize ListBox1. I get a "Method or data member not found (Error 461)". Also, it looks like a I need a class module in order to use the Me object. Thanks ptaylor -----Original Message----- Here is some code as a starter With Me.ListBox1 For i = 0 To .ListCount - 1 If .Selected(i) Then Msgbox .List(i) End If Next i End With -- HTH RP (remove nothere from the email address if mailing direct) "ptaylor" wrote in message ... I have created a list box on a worksheet and can set its properties in VBA as follows: ActiveSheet.Shapes ("ListBox1").ControlFormat.ListFillRange = "B5:B8" ActiveSheet.Shapes ("ListBox1").ControlFormat.MultiSelect = xlExtended How do I determine the list items that have been selected? The .Selected(index) (boolean) property is not a property of the ControlFormat object. TIA P Taylor . |
#5
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I dragged a list box from the Forms toolbar and drew it to
the size I wanted. I think I may have figured it out though. This appears to work (testing the item with index 2 as an example): Sub test() Dim blnTemp As Boolean ActiveSheet.Shapes("ListBox1").Select With Selection blnTemp = .Selected(2) End With End Sub Many thanks for your comments. -----Original Message----- Sorry, I gave you code for a Forms listbox. How did you create it? -- HTH RP (remove nothere from the email address if mailing direct) "ptaylor" wrote in message ... Bob, I can't get it to recognize ListBox1. I get a "Method or data member not found (Error 461)". Also, it looks like a I need a class module in order to use the Me object. Thanks ptaylor -----Original Message----- Here is some code as a starter With Me.ListBox1 For i = 0 To .ListCount - 1 If .Selected(i) Then Msgbox .List(i) End If Next i End With -- HTH RP (remove nothere from the email address if mailing direct) "ptaylor" wrote in message ... I have created a list box on a worksheet and can set its properties in VBA as follows: ActiveSheet.Shapes ("ListBox1").ControlFormat.ListFillRange = "B5:B8" ActiveSheet.Shapes ("ListBox1").ControlFormat.MultiSelect = xlExtended How do I determine the list items that have been selected? The .Selected(index) (boolean) property is not a property of the ControlFormat object. TIA P Taylor . . |
#6
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Sorry I misled you. Glad you sorted it.
Bob "ptaylor" wrote in message ... I dragged a list box from the Forms toolbar and drew it to the size I wanted. I think I may have figured it out though. This appears to work (testing the item with index 2 as an example): Sub test() Dim blnTemp As Boolean ActiveSheet.Shapes("ListBox1").Select With Selection blnTemp = .Selected(2) End With End Sub Many thanks for your comments. -----Original Message----- Sorry, I gave you code for a Forms listbox. How did you create it? -- HTH RP (remove nothere from the email address if mailing direct) "ptaylor" wrote in message ... Bob, I can't get it to recognize ListBox1. I get a "Method or data member not found (Error 461)". Also, it looks like a I need a class module in order to use the Me object. Thanks ptaylor -----Original Message----- Here is some code as a starter With Me.ListBox1 For i = 0 To .ListCount - 1 If .Selected(i) Then Msgbox .List(i) End If Next i End With -- HTH RP (remove nothere from the email address if mailing direct) "ptaylor" wrote in message ... I have created a list box on a worksheet and can set its properties in VBA as follows: ActiveSheet.Shapes ("ListBox1").ControlFormat.ListFillRange = "B5:B8" ActiveSheet.Shapes ("ListBox1").ControlFormat.MultiSelect = xlExtended How do I determine the list items that have been selected? The .Selected(index) (boolean) property is not a property of the ControlFormat object. TIA P Taylor . . |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
can I have a multiselect option for a list box in excel 2003 | Excel Discussion (Misc queries) | |||
How do I create a multiselect drop down list | Excel Worksheet Functions | |||
Multiselect Listbox | Excel Programming | |||
multiselect listbox | Excel Programming | |||
Multiselect Boxes | Excel Programming |