Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Can you place a combo box in a custom toolbar?


Is is possible to place combo boxes in a toolbar? How is it done?


------------------------------------------------
~~ Message posted from http://www.ExcelTip.com/
~~View and post usenet messages directly from http://www.ExcelForum.com/

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 7,247
Default Can you place a combo box in a custom toolbar?

Try something like the following:

Sub Init()
Dim Cbx As Office.CommandBarComboBox
Set Cbx = Application.CommandBars("Standard").Controls.Add( _
Type:=msoControlComboBox)
With Cbx
.Caption = "Choose"
.Tag = "Combobox1"
.AddItem "Item 1"
.AddItem "Item 2"
.AddItem "Item 3"
.OnAction = ThisWorkbook.Name & "!CbxClick"
End With
End Sub

Sub CbxClick()
Dim Cbx As Office.CommandBarComboBox
Set Cbx = Application.CommandBars.ActionControl
MsgBox "You choose: " & Cbx.List(Cbx.ListIndex)
End Sub


--
Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting, LLC
www.cpearson.com


"coosk" wrote in message
...

Is is possible to place combo boxes in a toolbar? How is it done?


------------------------------------------------
~~ Message posted from
http://www.ExcelTip.com/
~~View and post usenet messages directly from http://www.ExcelForum.com/



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
Combo Box selection to place $0 into another cell John Excel Discussion (Misc queries) 16 July 22nd 06 01:17 PM
How do I place font buttons on the Toolbar topsquark Excel Discussion (Misc queries) 2 March 30th 06 07:04 PM
"Combo Box - getting control combo box to stick in place in worksh ajr Excel Discussion (Misc queries) 1 February 16th 05 02:05 AM
"Combo Box - getting control combo box to stick in place in worksh ajr Excel Discussion (Misc queries) 0 February 15th 05 07:45 PM
saving toolbar buttons on custom toolbar Paul James Excel Programming 12 August 6th 03 08:28 AM


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