Coding Barang Baik
Coding Barang Baik
Coding Barang Baik
Option Explicit
If Me.TXTIDINV.Value = "" _
Or Me.TXTNAMA.Value = "" _
Or Me.CMBJENIS.Value = "" _
Or Me.CMBSATUAN.Value = "" _
Or Me.CMBRUANG.Value = "" _
Call MsgBox("Harap isi data barang dengan lengkap", vbInformation, "Data Barang")
Else
Call AmbilBarangBaik
Me.TXTIDINV.Value = ""
Me.TXTNAMA.Value = ""
Me.TXTDESKRIPSI.Value = ""
Me.CMBJENIS.Value = ""
Me.CMBSATUAN.Value = ""
Me.CMBRUANG.Value = ""
Me.TXTJUMLAHBAIK.Value = ""
End If
End Sub
DBARANG = Application.WorksheetFunction.CountA(Sheet3.Range("A5:A900000"))
If DBARANG = 0 Then
Me.TABELBARANG.RowSource = ""
Else
End If
End Sub
Sheet3.Range("N4").Value = Me.CMBBERDASARKAN.Value
Sheet3.Range("N5").Value = Me.TXTKATAKUNCI.Value
If Application.WorksheetFunction.CountA(Sheet3.Range("P5:P999999")) = 0 Then
Me.TABELBARANG.RowSource = ""
Else
Me.TABELBARANG.RowSource = "BARANGBAIK!P5:AA" & iRow
End If
Exit Sub
Salah:
End Sub
Application.ScreenUpdating = False
Call MsgBox("Silahkan tekan tombol cari terlebih dahulu untuk mencetak Laporan", vbInformation,
"Cetak Barang Baik")
Else
Case vbNo
Exit Sub
Case vbYes
End Select
Unload Me
Sheet3.PrintPreview
FORMBARANGBAIK.Show
End If
Sheet1.Select
End Sub
Application.ScreenUpdating = False
Else
Case vbNo
Exit Sub
Case vbYes
End Select
Sheet3.Select
Selection.EntireRow.Delete
Me.CMDADD.Enabled = True
Call AmbilBarangBaik
Me.TXTIDINV.Value = ""
Me.TXTNAMA.Value = ""
Me.TXTDESKRIPSI.Value = ""
Me.CMBJENIS.Value = ""
Me.CMBSATUAN.Value = ""
Me.CMBRUANG.Value = ""
Me.TXTJUMLAHBAIK.Value = ""
Me.TXTNOMOR.Value = ""
Sheet1.Select
End If
End Sub
Me.TXTNAMA.Value = ""
Me.TXTDESKRIPSI.Value = ""
Me.CMBJENIS.Value = ""
Me.CMBSATUAN.Value = ""
Me.CMBRUANG.Value = ""
Me.TXTJUMLAHBAIK.Value = ""
Me.TXTNOMOR.Value = ""
Me.CMBBERDASARKAN.Value = ""
Me.TXTKATAKUNCI.Value = ""
Call AmbilBarangBaik
End Sub
Application.ScreenUpdating = False
Call MsgBox("Untuk mengubah Data, Pilih data terlebih dahulu", vbInformation, "Ubah Data")
Else
Me.TXTIDINV.Value = ""
Me.TXTNAMA.Value = ""
Me.TXTDESKRIPSI.Value = ""
Me.CMBJENIS.Value = ""
Me.CMBSATUAN.Value = ""
Me.CMBRUANG.Value = ""
Me.TXTJUMLAHBAIK.Value = ""
Me.TXTNOMOR.Value = ""
End If
End Sub
Application.ScreenUpdating = False
Me.TXTNOMOR.Value = Me.TABELBARANG.Value
Me.TXTIDINV.Value = Me.TABELBARANG.Column(1)
Me.TXTNAMA.Value = Me.TABELBARANG.Column(2)
Me.TXTDESKRIPSI.Value = Me.TABELBARANG.Column(3)
Me.CMBJENIS.Value = Me.TABELBARANG.Column(4)
Me.CMBSATUAN.Value = Me.TABELBARANG.Column(5)
Me.CMBRUANG.Value = Me.TABELBARANG.Column(6)
Me.TXTJUMLAHBAIK.Value = Me.TABELBARANG.Column(7)
Me.CMDADD.Enabled = False
Sheet3.Select
CELLAKTIF = ActiveCell.Row
Sheet1.Select
Exit Sub
EXCELVBA:
End Sub
Call AmbilBarangBaik
With CMBJENIS
End With
.AddItem "Buah"
.AddItem "Kotak"
.AddItem "Meter"
.AddItem "Lusin"
End With
With CMBRUANG
End With
With CMBBERDASARKAN
.AddItem "Ruang"
End With
End Sub