Hi,
ich möchte eine ComboBox zur Laufzeit hinzufügen. Und mit jedem Klick soll mit einem bestimmten Abstand eine weitere ComboBox hinzugefügt werden. Leider wird keine weitere Combobox im Abstand von 50px erstellt. Ich vermute der Counter arbeitet nicht so wie er soll. Ich stehe jedoch auf dem Schlauch.
Private Sub AddProduct_Click()
Dim AddComboBox As MSForms.ComboBox
Dim ClickCount As Integer
ClickCount = ClickCount + 1
Set AddComboBox = EingabeFormular.Controls.Add("Forms.ComboBox.1")
Worksheets("PriceList").Activate
With AddComboBox
.Name = "ProductComboBox" & ClickCount
.Left = 35
.Top = 35 * ClickCount
.Font.Size = 11
.RowSource = "A2:A200"
.Width = 200
.ListWidth = 500
End With
End Sub
|