zu Commandbuttons-Textfelder hinzu...
10.02.2013 11:58:49
robert
Hi,
mit diesem Code erstellt man eine Anzahl von Commandbutons in einem Userform.
Ich bräuchte jetzt neben den Conmmandbuttons eine Textbox.
Ich habs probiert, aber ich schaff es nicht :-(
Wer kann helfen ?
Gruß
robert
Private Sub UserForm_Initialize()
Dim i As Integer, obTemp As MSForms.CommandButton
Dim txt As MSForms.TextBox
Dim a As Long
a = 20
For i = 2 To Cells(Rows.Count, 1).End(xlUp).Row
Set obTemp = Me.Controls.Add("Forms.CommandButton.1", "cmd" & 1, True)
obTemp.Width = 80
obTemp.Height = 25
obTemp.Left = 50
obTemp.Top = a + 20
obTemp.Caption = "" & Cells(i, 1)
Set aCommands(i).DieCmds = obTemp
a = a + 30
Next i
End Sub