Problems getting PowerPoint Combobox to list items correctly
Posted
by mike toyn
on Stack Overflow
See other posts from Stack Overflow
or by mike toyn
Published on 2010-05-14T14:05:41Z
Indexed on
2010/05/14
15:14 UTC
Read the original article
Hit count: 191
I am creating a PowerPoint in which I want users to be able to select an item from a list in a combo box. Nothing needs to happen after this, it is just to provide a record, on screen, of their choice.
My problem is that I seem to either be able to populate the combo box and users can select an item but the list gets longer each time the combobox is clicked on (i.e each time it is clicked on the list gets duplicated). Or alternatively, I can clear the combo box, then populate it but in this scenario, the users choice also seems to get cleared.
VBA example 1:
Private Sub ComboBox1_DropButtonClick()
With ComboBox1
.AddItem " ", 0
.AddItem "speed", 1
.AddItem "provisionality", 2
.AddItem "automation", 3
.AddItem "replication", 4
.AddItem "communicability", 5
.AddItem "multi-modality", 6
.AddItem "non-linearity", 7
.AddItem "capacity", 8
.AddItem "interactivity", 9
End With
End Sub
VBA example 2:
Private Sub ComboBox1_DropButtonClick()
ComboBox1.Clear
With ComboBox1
.AddItem " ", 0
.AddItem "speed", 1
.AddItem "provisionality", 2
.AddItem "automation", 3
.AddItem "replication", 4
.AddItem "communicability", 5
.AddItem "multi-modality", 6
.AddItem "non-linearity", 7
.AddItem "capacity", 8
.AddItem "interactivity", 9
End With
End Sub
Can anyone help?
© Stack Overflow or respective owner