Sub ABC()
Dim sArr(), Res() As String, Res2() As String
Dim sRow&, i&, tk$
With Sheet1
i = .Range("M" & Rows.Count).End(xlUp).Row
If i < 2 Then MsgBox ("Khong co du lieu"): Exit Sub
sArr = .Range("F2:N" & i).Value
sRow = UBound(sArr)
ReDim Res(1 To sRow, 1 To 1)
ReDim Res2(1 To sRow, 1 To 2)
For i = 1 To sRow
If sArr(i, 1) Like "T?I KHO?N*" Then
tk = Right(sArr(i, 1), 4)
ElseIf sArr(i, 9) <> Empty Then
Res2(i, 2) = Right(sArr(i, 9), 4)
End If
Res(i, 1) = tk
If sArr(i, 5) <> Empty Then
j = InStr(1, sArr(i, 5), "]")
If j > 0 Then Res2(i, 1) = Mid(sArr(i, 5), 2, j - 2)
End If
Next i
.Range("A2").Resize(sRow) = Res
.Range("C2").Resize(sRow, 2) = Res2
End With
End Sub