Private Sub cmdAdd_Click()
If Trim(txtHT) = "" Then
MsgBox "Vui long nhap ho ten!", vbInformation, "THÔNG BÁO": txtHT.SetFocus: Exit Sub
ElseIf Trim(txtNS) = "" Then
MsgBox "Vui long nhap ngay thang nam sinh!", vbInformation, "THÔNG BÁO": txtNS.SetFocus: Exit Sub
ElseIf Trim(txtQQ) = "" Then
MsgBox "Vui long nhap que quan!", vbInformation, "THÔNG BÁO": txtQQ.SetFocus: Exit Sub
ElseIf Trim(txtNN) = "" Then
MsgBox "Vui long nhap nghe nghiep!", vbInformation, "THÔNG BÁO": txtNN.SetFocus: Exit Sub
End If
Dim NextRow As Long
NextRow = Sheet1.[A65536].End(xlUp).Row + 1
With Sheet1.Cells(NextRow, 1)
.Value = txtHT
.Offset(, 1).Value = Format(txtNS, "mm/dd/yyyy")
.Offset(, 2).Value = txtQQ
.Offset(, 3).Value = txtNN
End With
txtHT = "": txtNS = "": txtQQ = "": txtNN = "": txtHT.SetFocus
End Sub