msoControlComboBox Value

G

Guest

I've created a new toolbar combobox but I can't figure out how to retrieve
the value that's been selected... Help

Here's the code...
------------------------------------------------------------------------------------------------
Sub JumpToAdd()

Set MyBar = CommandBars.Add(Name:="Jump To:", Position:=msoBarTop,
Temporary:=True)
MyBar.Visible = True
Set newCombo = MyBar.Controls.Add(Type:=msoControlComboBox)
With newCombo
.Width = 100
.AddItem "Home"
.AddItem "Properties"
.AddItem "PropertiesMPa"
.AddItem "Chrysler Stats L"
.AddItem "Chrysler Stats T"
.AddItem "Chrysler Stats D"
.AddItem "Ford Stats L"
.AddItem "Ford Stats T"
.AddItem "Ford Stats D"
.AddItem "GM Stats L"
.AddItem "GM Stats T"
.AddItem "GM Stats D"
.AddItem "GMC D Stats L"
.AddItem "GMC D Stats T"
.AddItem "GMC D Stats D"
.AddItem "Honda Stats L"
.AddItem "Honda Stats T"
.AddItem "Honda Stats D"
.AddItem "Nissan Stats L"
.AddItem "Nissan Stats T"
.AddItem "Nissan Stats D"
.AddItem "Toyota Stats L"
.AddItem "Toyota Stats T"
.AddItem "Toyota Stats D"
.Style = msoComboNormal
.OnAction = "JumpTo"
End With
End Su
------------------------------------------------------------------------------------------------
Sub JumpTo()

**** Retrieve Combobox Value and Execute Script ****

End Sub
 
J

Jim Rech

Sub JumpTo()
With CommandBars.ActionControl
MsgBox .List(.ListIndex)
End With
End Sub
 
B

Bob Phillips

Sub JumpTo()
With Application.CommandBars.ActionControl
MsgBox .Text
End With
End Sub


--
HTH

Bob

(there's no email, no snail mail, but somewhere should be gmail in my addy)
 
J

Jim Rech

Sub JumpTo()
Msgbox CommandBars.ActionControl.Text
End Sub

--
Jim
| I've created a new toolbar combobox but I can't figure out how to retrieve
| the value that's been selected... Help
|
| Here's the code...
| ------------------------------------------------------------------------------------------------
| Sub JumpToAdd()
|
| Set MyBar = CommandBars.Add(Name:="Jump To:", Position:=msoBarTop,
| Temporary:=True)
| MyBar.Visible = True
| Set newCombo = MyBar.Controls.Add(Type:=msoControlComboBox)
| With newCombo
| .Width = 100
| .AddItem "Home"
| .AddItem "Properties"
| .AddItem "PropertiesMPa"
| .AddItem "Chrysler Stats L"
| .AddItem "Chrysler Stats T"
| .AddItem "Chrysler Stats D"
| .AddItem "Ford Stats L"
| .AddItem "Ford Stats T"
| .AddItem "Ford Stats D"
| .AddItem "GM Stats L"
| .AddItem "GM Stats T"
| .AddItem "GM Stats D"
| .AddItem "GMC D Stats L"
| .AddItem "GMC D Stats T"
| .AddItem "GMC D Stats D"
| .AddItem "Honda Stats L"
| .AddItem "Honda Stats T"
| .AddItem "Honda Stats D"
| .AddItem "Nissan Stats L"
| .AddItem "Nissan Stats T"
| .AddItem "Nissan Stats D"
| .AddItem "Toyota Stats L"
| .AddItem "Toyota Stats T"
| .AddItem "Toyota Stats D"
| .Style = msoComboNormal
| .OnAction = "JumpTo"
| End With
| End Sub
| ------------------------------------------------------------------------------------------------
| Sub JumpTo()
|
| **** Retrieve Combobox Value and Execute Script ****
|
| End Sub
|
|
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Top