Private Sub cmdinput_Click()
Dim kodenama As String
Dim NAMA As Range
Dim kolom As Long
Dim KolomKosong As Long
kodenama = Me.ComboBox1.Value
With Worksheets("angsuran")
Set NAMA = .Cells.Find(kodenama, LookIn:=xlValues)
If Not NAMA Is Nothing Then
kolom = NAMA.Column
KolomKosong = .Cells(NAMA.Row, kolom).End(xlToRight).Offset(0, 1).Column
Me.DTPicker1.Value = .Cells(KolomKosong).Value
Me.TextBox1.Value = .Cells(KolomKosong + 2).Value
Else
MsgBox kodenama & " value not found in the sheet", vbExclamation
End If
End With
End Sub
Private Sub CommandButton1_Click()
Unload Me
End Sub
Private Sub TextBox1_Change()
TextBox1 = Format(TextBox1, "Rp#,##0")
End Sub
Private Sub UserForm_Initialize()
Dim c As Range
With Worksheets("angsuran")
For Each c In .Range(.Range("b7"), .Range("b" & .Rows.Count).End(xlUp))
If c.Value <> "" Then ComboBox1.AddItem c.Value
Next c
End With
End Sub
Sub BERSIHKAN()
Dim AdaText
For Each AdaText In Me.Controls
If TypeOf AdaText Is MSForms.TextBox Then
AdaText.Text = ""
End If
Next AdaText
Me.TextBox1.SetFocus
End Sub
This all my code. Always error when i try to sumbit my data. Sorry if i make a mistake, cause me as beginer didn't have a teacher for vba code
Regards