Option Explicit
Sub XoaTrungSo()
'Tù 123456 Cho Dén 9876543'
Dim Jj As Long, Rws As Long, Ww As Byte, Col As Byte
Const KySo As String = "1234567890"
Dim sNum As String, StrC As String, VTr As String
ReDim So(0 To 9): Dim Timer_ As Double
Columns("A:AA").ClearContents
Timer_ = Timer: Col = 1
For Jj = 123456 To 9876543
sNum = CStr(Jj)
For Ww = 1 To Len(sNum)
StrC = Mid(sNum, Ww, 1)
So(CLng(StrC)) = 1 + So(CLng(StrC))
If So(CLng(StrC)) = 2 Then VTr = VTr & StrC
Next Ww
Rws = Cells(65535, Col).End(xlUp).Row
If Rws > 65500 Then
Col = Col + 2: Rws = 1
End If
If Len(VTr) > 0 Then
With Cells(Rws + 1, Col)
.Value = Jj: .Offset(, 1) = VTr
End With
VTr = ""
End If
For Ww = 0 To 9
So(Ww) = 0
Next Ww
9 If Timer - Timer_ > 99 Then
[A1].Value = Jj: Exit For
End If
Next Jj
End Sub