Public Sub AgregarControl(FormNombre As String)
Dim i As Integer 'contador
Dim MiControl As CommandButton ' Tipo de control
For i = 0 To VB.Forms.Count - 1 'Busca en cada elemento de la colección Forms
If (VB.Forms(i).Name = FormNombre) Then 'Indica a qué form se agrega el control
Set MiControl = VB.Forms(i).Controls.Add("VB.CommandButton", "Command2")
MiControl.Caption = "Agregado"
MiControl.Visible = True
End If
Next i
End Sub