VBA-Programmierung in Microsoft Excel

Tutorial: Excel-Beispiele

VBA-Begriff: Beispiel zur AddItem-Methode

In diesem Beispiel wird ein Listenfeld erstellt und mit Ganzzahlen von 1 bis 10 ausgefüllt.

With Worksheets(1)
    Set lb = .Shapes.AddFormControl(xlListBox, 100, 10, 100, 100)
    For x = 1 To 10
        lb.ControlFormat.AddItem x
    Next
End With