Gửi các bác, các bác xem giúp mình câu lệnh này mình sai như nào nhỉ, cảm ơn mọi người
Private Sub CommandButton6_Click()
Application.ScreenUpdating = False
Dim rg1 As Range
Dim rg2 As Range
Dim srg As Range
Dim lastrow1 As Long
Dim lastrow2 As Long
lastrow1 = Sheet1.Range("C" & Rows.Count).End(xlUp).Row
lastrow2 = Sheet3.Range("B" & Rows.Count).End(xlUp).Row + 1
Set rg1 = Sheet1.Range("A3:M" & lastrow1)
Set rg2 = Sheet1.Range("A4:M" & lastrow1)
rg1.AutoFilter Field:=13, Criteria1:="<>"
rg1.AutoFilter Field:=10, Criteria1:="<>"
rg2.SpecialCells(xlVisible).Copy
Sheet3.Range("A" & lastrow2).PasteSpecial Paste:=xlPasteValues, Operation:=xlNone
Application.CutCopyMode = False
rg1.AutoFilter
MsgBox ("Chuyen Nhat Ky thanh cong")
Application.ScreenUpdating = True
End Sub