A family of Microsoft spreadsheet software with tools for analyzing, charting, and communicating data.
Here is a starting point. It assumes that UserForm1 has already been created.
Sub CreateControls()
Dim ctl As MSForms.Control
With UserForm1
.Caption = "My Form"
With .Controls.Add(bstrProgID:="Forms.Label.1", Name:="Label1", Visible:=True)
.Left = 12
.Top = 12
.Width = 96
.Height = 18
.Caption = "My Label"
End With
With .Controls.Add(bstrProgID:="Forms.TextBox.1", Name:="TextBox1", Visible:=True)
.Left = 120
.Top = 12
.Width = 96
.Height = 18
.Text = "Some Text"
End With
.Show
End With
End Sub