Public Sub Merge_xls_Sheets_Copy_Destination()
Dim xlsFile As Variant
Dim xlsxFile As String
Dim xlsWb As Workbook
Dim xlsxWb As Workbook
Dim ws As Worksheet
Dim destCell As Range, destRange As Range
Dim ur As Range
xlsFile = "C:\path\to\demo.xls"
xlsxFile = Replace(xlsFile, ".xls", ".xlsx", Compare:=vbTextCompare)
Application.ScreenUpdating = False
Set xlsxWb = Workbooks.Add(xlWBATWorksheet)
Set destCell = xlsxWb.Worksheets(1).Range("A1")
Set xlsWb = Workbooks.Open(xlsFile)
For Each ws In xlsWb.Worksheets
Set ur = ws.UsedRange
Debug.Print ws.Name
Debug.Print ur.Address, ur.Row & " to " & ur.Row + ur.Rows.Count - 1, ur.Rows.Count & " rows"
If ur.Rows.Count = 65536 Then
Set ur = ur.Resize(ur.Rows.Count - 1)
Set destRange = destCell.Resize(ur.Rows.Count, ur.Columns.Count).Offset(ur.Row - 1, 1)
Debug.Print "Copy " & ur.Address & " to " & destRange.Address
ur.Copy destRange
Set destRange = destCell.Resize(1, ur.Columns.Count).Offset(ur.Row - 1 + ur.Rows.Count, ur.Column - 1)
Debug.Print "Copy " & ur.Resize(1).Offset(ur.Rows.Count).Address & " to " & destRange.Address
ur.Resize(1).Offset(ur.Rows.Count).Copy destRange
Else
Set destRange = destCell.Resize(ur.Rows.Count, ur.Columns.Count)
Debug.Print "Copy " & ur.Address & " to " & destRange.Address
ur.Copy destCell.Resize(ur.Rows.Count, ur.Columns.Count)
End If
With destCell.Worksheet
Set destCell = .Cells(.Rows.Count, "A").End(xlUp).Offset(1)
End With
Next
xlsWb.Close False
Application.DisplayAlerts = False
xlsxWb.Close True, xlsxFile
Application.DisplayAlerts = True
Application.ScreenUpdating = True
End Sub