Gruppe
Dialog
Problem
Im aktiven Blatt soll eine ComboBox mit den Monatsnamen als Inhalt erstellt werden.
StandardModule: Modul1
Sub NewCboBox()
Dim cbo As OLEObject
Dim iCounter As Integer
Range("A1").Select
Set cbo = ActiveSheet.OLEObjects.Add( _
ClassType:="Forms.ComboBox.1", _
Link:=False, _
DisplayAsIcon:=False, _
Left:=40, _
Top:=40, _
Width:=170, _
Height:=20)
For iCounter = 1 To 12
cbo.Object.AddItem Format(DateSerial(1, iCounter, 1), "mmmm")
Next iCounter
cbo.Object.ListIndex = 0
End Sub