@Deri Prayudi ...khusunya untuk form Hapus data nya..
coba scrip berikut:
Private Sub hapus_Click()
With Lembar1
hapusBarisData (npm)
Unload me
End With
End Sub
Private Sub npm_Change()
If Len(npm) = 6 Then
LoadData (npm)
End If
End Sub
'skrip untuk load data sesuai nomor NPM
Private Sub LoadData(npm As Long)
With Lembar1
x = .Range("A" & Rows.Count).End(xlUp).Row
For Each sel In .Range("B3:B" & x)
If sel.Value = npm Then
n = sel.Row
Me.nama = .Cells(n, 3)
Me.alamat = .Cells(n, 4)
Me.tempatlahir = .Cells(n, 5)
Me.cmbTglLahir = Format(.Cells(n, 6), "dd")
Me.cmbBulan = Format(.Cells(n, 6), "mm")
Me.cmbTahun = Format(.Cells(n, 6), "yyyy")
Me.cmbKelamin = .Cells(n, 7)
Me.cmbProdi = .Cells(n, 8)
Me.cmbMataKuliah = .Cells(n, 9)
Me.cmbNilai = .Cells(n, 10)
Me.tanggalujian = .Cells(n, 11)
Me.serisertifikat = .Cells(n, 12)
End If
Next
End With
End Sub
'skrip untuk hapus data
Private Sub hapusBarisData(npm As Long)
With Lembar1
x = .Range("A" & Rows.Count).End(xlUp).Row
For Each sel In .Range("B3:B" & x)
If sel.Value = npm Then
.Cells(sel.Row, 1).EntireRow.Delete
End If
Next
End With
End Sub
@Deri Prayudi ....mhon bantuannya jg untuk script jika ada data yang sudah terinput, atau menghindari data ganda maka system akan memberikan opsi simpan atau batal.....
ini maksudnya form yang mana ? apakah FormInputData ?
jika ya maka patokan data gandanya dimana, apakah NPM ?
@Deri Prayudi @manweljs_ terima kasih attention nya master
saya bukan master, panggil nama aja :)