Sub copyTN()
Dim s As Long, i As Integer, j As Long, k As Long, endR As Long
Dim T, shName As String, myRng As Range
T = Timer
Application.DisplayAlerts = False
Application.ScreenUpdating = False
Dim Arr(), ArrKQ(1 To 30, 1 To 10)
With Pr
.Cells.Clear
.[A1].Resize(1, 10).Value = Sheets("1").[a2].Resize(1, 10).Value
endR = 2
For i = 1 To 31
s = 0: shName = CStr(i)
With Sheets(shName)
Arr = .[a3].Resize(60, 10).Value
For j = 1 To 60
If Len(Arr(j, 1)) > 0 Then
If Len(Arr(j, 3)) > 0 Then
s = s + 1
For k = 1 To 10
ArrKQ(s, k) = Arr(j, k)
Next k
End If
End If
Next j
End With
If s = 0 Then GoTo bien
.Range("A" & endR).Resize(s, 10) = ArrKQ
endR = endR + s
bien:
Next i
Set myRng = .[a2].Resize(endR - 2, 10)
With myRng
.Sort Key1:=myRng.Cells(1, 3), Order1:=xlAscending, Header:=xlNo
End With
End With
Set myRng = Nothing
Erase Arr, ArrKQ
Application.DisplayAlerts = True
Application.ScreenUpdating = True
MsgBox Timer - T
End Sub