Em mới nhập môn vba, qua tìm hiểu trên diễn đàn em tự viết được đoạn code sau:
bác nào giúp em rút gọn đoạn code trên với ạ. Em cảm ơn nhiều.
Mã:
Private Sub Ghidulieu_Click()
If txtBCThang.Text = "" Then
MsgBox "Chua nhap du lieu: Báo cáo tháng"
End If
If txtTGNhaplieu.Text = "" Then
MsgBox "Chua nhap du lieu: Thoi gian nhap du lieu"
End If
If cktHU.Value = False And cktCQTMCapUyHuyen.Value = False And cktDUCoSo.Value = False And cktDUBoPhan.Value = False And cktChiBo.Value = False Then
MsgBox "Chua nhap du lieu: Cap kiem tra"
End If
If ndktChapHanhQCLV.Value = False And ndktPhamChat.Value = False And ndktChucTrach.Value = False And ndktDVKDL.Value = False And ndktKhac.Value = False Then
MsgBox "Chua nhap du lieu: Noi dung kiem tra"
End If
If klTot.Value = False And klChuaTot.Value = False And klCoKhuyetDiem.Value = False And klPhaiTHKL.Value = False And klChuaKL.Value = False Then
MsgBox "Chua nhap du lieu: Ket luan"
End If
If dvtcqlCapTinh.Value = False And dvtcqlCapHuyen.Value = False And dvtcqlCapCoSo.Value = False Then
MsgBox "Chua nhap du lieu: Dang vien o cac cap quan ly"
End If
If cuvccTinhUyVien.Value = False And cuvccHuyenUyVien.Value = False And cuvccDangUyVien.Value = False And cuvccChiUyVien.Value = False Then
MsgBox "Chua nhap du lieu: La cap uy vien cac cap"
End If
If dvoclvDang.Value = False And dvoclvNhaNuoc.Value = False And dvoclvDoanThe.Value = False And dvoclvLLVT.Value = False And dvoclvSXKDDV.Value = False Then
MsgBox "Chua nhap du lieu: Dang vien o cac linh vuc"
End If
End Sub