Dim cmdButton(4) As CommandButton Private Sub Form_Load() Dim i As Integer For i = 0 To 4 Set cmdButton(i) = Me.Controls.Add("VB.CommandButton", "cmdButton" & Me.Controls.Count) With cmdButton(i) .Left = 750 * i .Top = 1000 .Width = 700 .Height = 500 .Caption = "Hello" .Visible = True End With Next i End Sub Private Sub Form_Unload(Cancel As Integer) Dim i As Integer For i = 0 To 4 Set cmdButton(i) = Nothing Next i End Sub