You are on page 1of 1

Private Sub CommandButton1_Click()

Dim bariskosong As Long


Sheets("sheet1").Activate
baris kosong = WorksheetFunction.CountA(Range("B:B")) + 4

If Trim(Me.TextBox1.Value) = "" Then


Me.TextBox1.SetFocus
MagBox "Data ini Harus di Isi Dengan Benar"
Exit Sub
End If

Cells(bariskosong, 2).Value = TextBox1.Value


Cells(bariskosong, 3).Value = TextBox6.Value
Cells(bariskosong, 4).Value = TextBox5.Value
Cells(bariskosong, 5).Value = TextBox4.Value
Cells(bariskosong, 6).Value = TextBox3.Value
Cells(bariskosong, 7).Value = TextBox2.Value

End Sub

Private Sub CommanButton2_Click()


TextBox1.Value = ""
TextBox6.Value = ""
TextBox5.Value = ""
TextBox4.Value = ""
TextBox3.Value = ""
TextBox2.Value = ""
End Sub

You might also like