Option Explicit Private Sub CommandButton1_Click() Dim Q, W, E, R, KoefNasel, koefkom As Double Q = CDbl(TextBox1.Text) W = CDbl(TextBox2.Text) E = CDbl(TextBox3.Text) F = CDbl(TextBox4.Text) Raz = Q+W+E+F TextBox5.Text = Format(Raz, "#,##0.00") End Sub Private Sub AddRec_Click() Dim X&, Y& With Me .CountRec = .CountRec + 1 X = 2 Y = Val(.CountRec - 1) * 25 + 20 .AddRec.Top = Y .ScrollHeight = Y + 25 .ScrollTop = Y CreateFrameRec .CountRec.Value, X, Y 'If events Then .Controls("ChildName" & .CountChild.Value).SetFocus End With End Sub Private Sub CreateFrameRec(ByVal N As Long, ByVal X As Long, ByVal Y As Long) Dim fr As MSForms.Frame, TB1 As MSForms.TextBox, lLineNum&, sProcLines$ Set fr = Me.Controls.Add("Forms.Frame.1") With fr .Width = 600 .Height = 23 .Left = X .Top = Y .Caption = "" .Tag = "" .Name = "Rec" & N .SpecialEffect = fmSpecialEffectFlat End With Set arrRec(N, 1) = Me.Controls("Rec" & N).Controls.Add("Forms.TextBox.1") With arrRec(N, 1) .Name = "TextBox" .Height = 18 .Width = 100 .Top = 2 .Left = 4 End With Set arrRec(N, 2) = Me.Controls("Rec" & N).Controls.Add("Forms.TextBox.1") With arrRec(N, 2) .Name = "TextBox" .Height = 18 .Width = 100 .Top = 2 .Left = 124 End With Set arrRec(N, 3) = Me.Controls("Rec" & N).Controls.Add("Forms.TextBox.1") With arrRec(N, 3) .Name = "TextBox" .Height = 18 .Width = 100 .Top = 2 .Left = 244 End With Set arrRec(N, 4) = Me.Controls("Rec" & N).Controls.Add("Forms.TextBox.1") With arrRec(N, 4) .Name = "TextBox" .Height = 18 .Width = 100 .Top = 2 .Left = 364 End With Set arrRec(N, 5) = Me.Controls("Rec" & N).Controls.Add("Forms.TextBox.1") With arrRec(N, 5) .Name = "TextBox" .Height = 18 .Width = 100 .Top = 2 .Left = 484 End With End Sub Private Sub UserForm_Initialize() CreateFrameRec 1, 2, 22 End Sub