View Single Post
  #4   Report Post  
Posted to microsoft.public.excel.programming
Jim Cone Jim Cone is offline
external usenet poster
 
Posts: 3,290
Default Populating combobox in custom toolbar

Well so much for winging it.
It doesn't work for me either.
Here is some sample code that does work.
You should be able to modify and use it.
Jim Cone
San Francisco, USA
http://www.realezsites.com/bus/primitivesoftware

'---------------------
Sub MakeCustomToolbar()
Dim cmdBar As Office.CommandBar
Dim cmdComBox As Office.CommandBarControl
Dim rngList As Excel.Range
Dim lngN As Long

Set cmdBar = Application.CommandBars.Add("AnotherBeer", msoBarFloating, False)
Set cmdComBox = cmdBar.Controls.Add(msoControlComboBox)
Set rngList = Worksheets(1).Range("A1:A3181")

For lngN = 1 To 3181
cmdComBox.AddItem rngList(lngN).Value
Next
cmdBar.Visible = True

Set rngList = Nothing
Set cmdBar = Nothing
Set cmdComBox = Nothing
End Sub
'-----------

"Bill_excelforum"
<Bill_excelforum.25ev6n_1143601803.0705@excelfor um-nospam.com
wrote in message
That doesn't seem to work....
--
Bill_excelforum