dslreports logo
site
 
    All Forums Hot Topics Gallery
spc

spacer




how-to block ads


Search Topic:
uniqs
564
share rss forum feed


jjwaldick

join:2005-11-01
St Williams, ON

[Other] Microsoft Powerpoint 2003-2010

I have a client that is using PowerPoint for displaying a map to a class. He would like to have a combo box or a drop down menu to select different names and also another drop down box to select different colors. Right now he needs to open the toolbox or object box to change the color, and he doesn't want to do all that just select a predefined color from a drop down. When he selects the color he wants it to change to that color. Ex. Green,Yellow, and Red.



jjwaldick

join:2005-11-01
St Williams, ON

Found the answer. For anyone that might of be wondering.

Option Explicit

Sub LoadMe()
ComboBox1.AddItem "Green"
ComboBox1.AddItem "Yellow"
ComboBox1.AddItem "Red"
ComboBox1.ListRows = 3
End Sub

Private Sub ComboBox1_GotFocus()
If ComboBox1.ListCount = 0 Then
LoadMe
End If
End Sub

Private Sub ComboBox1_Change()
If ComboBox1.Value = "Green" Then
ComboBox1.BackColor = RGB(34, 139, 34)
ElseIf ComboBox1.Value = "Yellow" Then
ComboBox1.BackColor = RGB(255, 255, 0)
ElseIf ComboBox1.Value = "Red" Then
ComboBox1.BackColor = RGB(255, 0, 0)
Else
ComboBox1.BackColor = RGB(256, 256, 256)
End If
End Sub