Этот скрипт VBA сделает то, что вы ищете;просто измените Путь к папке, где у вас есть файлы, и заголовки, если вы не хотите, чтобы они оставались "A" и "B".
Sub RetrieveSort()
Dim Path As String, activeWB As String, wbDest As Workbook
Dim desSht As Worksheet, fileName As String, Wkb As Workbook, des As Range, src As Range
Dim StartCopyingFrom As Integer
'----------TO BE CHANGED----------
Path = "C:\Users\AN\Desktop\Data\" 'change folder to where the data is located
hdA = "A" 'change it to the header you want for column A, maybe Item?
hdB = "B" 'change it to the header you want for column B, maybe Time?
'----------TO BE CHANGED----------
activeWB = ActiveWorkbook.Name
StartCopyingFrom = 2 'we start copying from the second row to avoid duplicating the headers
Set desSht = Worksheets.Add 'this is to create the sheet where all data will be merged
fileName = Dir(Path & "\*.xls", vbNormal) 'this assumes that the files you intend to copy from are Excel files
If Len(fileName) = 0 Then Exit Sub
Do Until fileName = vbNullString
If Not fileName = activeWB Then
Set Wkb = Workbooks.Open(fileName:=Path & fileName)
Set src = Wkb.Sheets(1).Range(Cells(StartCopyingFrom, 1), _
Cells(ActiveSheet.UsedRange.Rows.Count, ActiveSheet.UsedRange.Columns.Count))
Set des = desSht.Range("A" & desSht.UsedRange.SpecialCells(xlCellTypeLastCell).Row + 1)
src.Copy des 'copying the data
Wkb.Close False 'we close the file after retrieving the data and close it without saving
End If
fileName = Dir()
Loop
Range("A1").Value = hdA
Range("B1").Value = hdB
lastRow = Range("A" & Rows.Count).End(xlUp).Row 'this will get the total number of rows, and it changes depending on your data
Range("A1:B" & lastRow).Select 'sorting by time
Selection.Sort Key1:=Range("B1"), Order1:=xlAscending, Header:=xlYes, OrderCustom:=1, MatchCase:= _
False, Orientation:=xlTopToBottom
End Sub