Sub Chuyen_du_lieu()
Dim lr As Integer, i As Integer, j As Integer, R1 As Integer, R2 As Integer, Col As Integer
Dim sArr(), dArr(), eArr()
Dim Nghi As String
Application.ScreenUpdating = False
With Sheet1
Nghi = .Range("P2").Value
If .AutoFilterMode = True Then .AutoFilterMode = False
lr = .Range("B" & Rows.Count).End(xlUp).Row
sArr = .Range("A3:J" & lr).Value2
Col = UBound(sArr, 2)
ReDim dArr(1 To UBound(sArr, 1), 1 To Col)
ReDim eArr(1 To UBound(sArr, 1), 1 To Col)
For i = 1 To UBound(sArr, 1)
If sArr(i, 10) <> Nghi Then
R1 = R1 + 1
For j = 1 To Col
dArr(R1, j) = sArr(i, j)
Next j
Else
R2 = R2 + 1
For j = 1 To Col
eArr(R2, j) = sArr(i, j)
Next j
End If
Next i
.Range("A3:J" & lr).ClearContents
.Range("A3").Resize(R1, Col).Value = dArr
End With
With Sheet2
If .AutoFilterMode = True Then .AutoFilterMode = False
lr = .Range("B" & Rows.Count).End(xlUp).Row + 1
If R2 > 0 Then .Range("A" & lr).Resize(R2, Col).Value = eArr
End With
Application.ScreenUpdating = True
End Sub