Coding Form Data Siswa
Coding Form Data Siswa
Coding Form Data Siswa
Option Explicit
If Me.TXTNISN.Value = "" _
Or Me.TXTNAMASISWA.Value = "" _
Or Me.CBKELAMIN.Value = "" _
Or Me.CBKELAS.Value = "" _
Or Me.CBKETERANGAN.Value = "" _
Or Me.TXTTAHUN.Value = "" _
Call MsgBox("Isi data barang masuk dengan lengkap", vbInformation, "Barang Masuk")
Else
Call AmbilData
Me.TXTNISN.Value = ""
Me.TXTNAMASISWA.Value = ""
Me.CBKELAMIN.Value = ""
Me.CBKELAS.Value = ""
Me.CBKETERANGAN.Value = ""
Me.TXTTAHUN.Value = ""
Me.TXTHPORTU.Value = ""
End If
End Sub
Sheet6.Range("K4").Value = Me.CBKRITERIA.Value
If Application.WorksheetFunction.CountA(Sheet6.Range("A5:A60000")) = 0 Then
Me.TABELDATA.RowSource = ""
Else
End If
Me.TXTJUMLAH.Value = Me.TABELDATA.ListCount
Exit Sub
Salah:
Application.ScreenUpdating = False
Me.TABELDATA.Value = ""
Else
Case vbNo
Exit Sub
Case vbYes
End Select
Sheet3.Select
Selection.EntireRow.Delete
Me.TXTNISN.Value = ""
Me.TXTNAMASISWA.Value = ""
Me.CBKELAMIN.Value = ""
Me.CBKELAS.Value = ""
Me.CBKETERANGAN.Value = ""
Me.TXTTAHUN.Value = ""
Me.TXTHPORTU.Value = ""
Sheet1.Select
End If
End Sub
Private Sub CMDRESET_Click()
Me.TXTNISN.Value = ""
Me.TXTNAMASISWA.Value = ""
Me.CBKELAMIN.Value = ""
Me.CBKELAS.Value = ""
Me.CBKETERANGAN.Value = ""
Me.TXTTAHUN.Value = ""
Me.TXTHPORTU.Value = ""
Me.CBKRITERIA.Value = ""
Me.TXTCARI.Value = ""
Call AmbilData
Me.CMDADD.Enabled = True
End Sub
Application.ScreenUpdating = False
Else
Sheet2.Select
BARIS = ActiveCell.Row
Cells(BARIS, 2) = Me.TXTNISN.Value
Cells(BARIS, 3) = Me.TXTNAMASISWA.Value
Cells(BARIS, 4) = Me.CBKELAMIN.Value
Cells(BARIS, 5) = Me.CBKELAS.Value
Cells(BARIS, 6) = Me.CBKETERANGAN.Value
Cells(BARIS, 7) = Me.TXTTAHUN.Value
Cells(BARIS, 8) = Me.TXTHPORTU.Value
Me.TXTNISN.Value = ""
Me.TXTNAMASISWA.Value = ""
Me.CBKELAMIN.Value = ""
Me.CBKELAS.Value = ""
Me.CBKETERANGAN.Value = ""
Me.TXTTAHUN.Value = ""
Me.TXTHPORTU.Value = ""
End If
Sheet1.Select
End Sub
End Sub
Application.ScreenUpdating = False
Me.TXTNISN.Value = Me.TABELDATA.Column(1)
Me.TXTNAMASISWA.Value = Me.TABELDATA.Column(2)
Me.CBKELAMIN.Value = Me.TABELDATA.Column(3)
Me.CBKELAS.Value = Me.TABELDATA.Column(4)
Me.CBKETERANGAN.Value = Me.TABELDATA.Column(5)
Me.TXTTAHUN.Value = Me.TABELDATA.Column(6)
Me.TXTHPORTU.Value = Me.TABELDATA.Column(7)
Sheet2.Select
CELLAKTIF = ActiveCell.Row
Sheet1.Select
Me.CMDADD.Enabled = False
Exit Sub
EXCELVBA:
End Sub
End Sub
Call AmbilData
With CBKELAMIN
.AddItem "Perempuan"
End With
With CBKELAS
With CBKETERANGAN
End With
With CBKRITERIA
.AddItem "Kelas"
End With
End Sub
TData = Application.WorksheetFunction.CountA(Sheet2.Range("B5:B10000"))
If TData = 0 Then
Me.TABELDATA.RowSource = ""
Else
End If
Me.TXTJUMLAH.Value = Me.TABELDATA.ListCount
End Sub