Option Explicit
Sub TEST_2()
Application.ScreenUpdating = False
Dim Y, N&, i&, j&, A, C%
Set Y = CreateObject("Scripting.Dictionary")
Sheets(3).UsedRange.Clear
For i = 1 To 2
Y("表" & i) = Sheets(i).Range("A1").CurrentRegion: A = Y("表" & i)
Y(i & "/R") = UBound(A): Y(i & "/C") = UBound(A, 2)
For j = 1 To Y(i & "/C")
N = N + 1: A(1, j) = Format(A(1, j), "000") & "|" & Format(N, "000")
Next
Y("表" & i) = A
Next
Sheets(3).[A1].Resize(Y("1/R"), Y("1/C")) = Y("表1")
Sheets(3).[A1].Item(1, Y("1/C") + 1).Resize(Y("2/R"), Y("2/C")) = Y("表2")
With Sheets(3).UsedRange
.Sort Key1:=.Item(1), Order1:=xlAscending, Header:=xlNo, _
Orientation:=xlLeftToRight
Intersect([1:1], .Cells).Replace "|*", "", Lookat:=xlPart
End With
Set Y = Nothing
End Sub