0% found this document useful (0 votes)
6 views1 page

Form Edit Jual

The document contains a VBA code for a user form in Excel that handles sales transactions. It updates a list with values from text boxes, calculates a subtotal, and formats the output. Additionally, it includes error handling and UI adjustments for the form's appearance.

Uploaded by

filmawati10
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
6 views1 page

Form Edit Jual

The document contains a VBA code for a user form in Excel that handles sales transactions. It updates a list with values from text boxes, calculates a subtotal, and formats the output. Additionally, it includes error handling and UI adjustments for the form's appearance.

Uploaded by

filmawati10
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
You are on page 1/ 1

Private Sub CommandButton1_Click()

On Error Resume Next


FORM_PENJUALAN.ListKERANJANG.Column(2) = Me.TextBox1.Text
FORM_PENJUALAN.ListKERANJANG.Column(5) = Me.TextBox2.Text
FORM_PENJUALAN.ListKERANJANG.Column(6) = Format(CDbl(Me.TextBox1.Text *
Me.TextBox2.Text), "#,##0")
FORM_PENJUALAN.ListKERANJANG.Column(7) = Me.TextBox3.Text
FORM_PENJUALAN.ListKERANJANG.Column(8) = Me.TextBox3.Value - Me.TextBox1.Value
Call RumusSubTotal
Unload Me
End Sub
Sub RumusSubTotal()
On Error Resume Next
Hitung = 0
For i = 1 To FORM_PENJUALAN.ListKERANJANG.ListCount - 1
Hitung = Hitung + (FORM_PENJUALAN.ListKERANJANG.List(i, 6))
FORM_PENJUALAN.TOTAL.Value = Hitung
Next i
FORM_PENJUALAN.TOTAL.Value = Format(CDbl(FORM_PENJUALAN.TOTAL.Value), "
#,##0")
End Sub

Private Sub Label1_Click()


Unload Me
End Sub

Private Sub TextBox2_Change()


On Error Resume Next
TextBox2.Value = Format(CDbl(TextBox2.Value), " #,##0")
End Sub
Private Sub UserForm_Initialize()
HideTitleBar Me
End Sub

You might also like