The document contains VBA code for a user form that manages inventory data, allowing users to add, delete, reset, and update item information. It includes error handling and user prompts for confirmation during deletion and ensures all fields are filled before adding new data. The form updates a data source in an Excel sheet and resets input fields after operations.
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 ratings0% found this document useful (0 votes)
9 views3 pages
Form Barang
The document contains VBA code for a user form that manages inventory data, allowing users to add, delete, reset, and update item information. It includes error handling and user prompts for confirmation during deletion and ensures all fields are filled before adding new data. The form updates a data source in an Excel sheet and resets input fields after operations.
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/ 3
Private Sub DELETE_Click()
On Error Resume Next
Application.ScreenUpdating = False If Me.KODE_BARANG.Value = "" Then Call MsgBox("Pilih data pada tabel data", vbInformation, "Hapus Data") Else Select Case MsgBox("Anda akan menghapus data" _ & vbCrLf & "Apakah anda yakin?" _ , vbYesNo Or vbQuestion Or vbDefaultButton1, "Hapus data") Case vbNo Exit Sub Case vbYes End Select Set Hapusdata = Sheet1.Range("A5:A40000").Find(What:=Me.KODE_BARANG.Value, LookIn:=xlValues) Hapusdata.Offset(0, 0).ClearContents Hapusdata.Offset(0, 1).ClearContents Hapusdata.Offset(0, 2).ClearContents Hapusdata.Offset(0, 3).ClearContents Hapusdata.Offset(0, 4).ClearContents Hapusdata.Offset(0, 5).ClearContents Hapusdata.Offset(0, 6).ClearContents
Call MsgBox("Data berhasil dihapus", vbInformation, "Hapus Data")