Private Sub CmdTao_Click()
Application.ScreenUpdating = False
Dim eRow As Long, ShVisible As Long
On Error GoTo BaoLoi
ShVisible = Sheet1.Visible
Sheet1.Visible = -1
Sheet1.Copy after:=Sheets(Sheets.Count)
Sheet1.Visible = ShVisible
ActiveSheet.Name = TxtLop
ActiveSheet.Unprotect "GPE"
Sheets("th").Unprotect "canthoq"
ActiveSheet.[B3] = TxtLop
eRow = Sheet6.[B1000].End(xlUp).Offset(1).Row
If eRow < 15 Then eRow = 15
Sheet6.Range("B" & eRow) = TxtLop
ActiveSheet.[D3].Clear
ActiveSheet.Protect "GPE"
Sheets("th").Protect "canthoq"
TxtLop = ""
TxtLop.SetFocus
Application.ScreenUpdating = True
Exit Sub
BaoLoi:
MsgBox "Chua nhap ten Sheet, ten Sheet khong hop le hoac da ton tai."
Application.DisplayAlerts = False
ActiveSheet.Delete
Application.DisplayAlerts = True
TxtLop = ""
TxtLop.SetFocus
Application.ScreenUpdating = True
End Sub