I have a workbook with over 128 sheets
I am tweaking a vba rountine that I thought did work including an additional column of name of worksheet
I thought it would combine all sheets in a workbook
can anyone see what is missing/not correct why not all the sheets and rows are being combined ?
Thank you
Sub combined()
Dim J As Integer
On Error Resume Next
Sheets(1).Select
Worksheets.Add
Sheets(1).Name = "Combined"
Sheets(2).Activate
ActiveSheet.Range("A1").EntireColumn.Insert
ActiveSheet.Range("A1:A" & Cells.Find("*", SearchOrder:=xlByRows, SearchDirection:=xlPrevious).Row).Value = ActiveSheet.Name
Range("A1").EntireRow.Select
Selection.Copy Destination:=Sheets(1).Range("A1")
ActiveSheet.Columns("A").EntireColumn.Delete
For J = 2 To Sheets.Count
Sheets(J).Activate
ActiveSheet.Range("A1").EntireColumn.Insert
ActiveSheet.Range("A1:A" & Cells.Find("*", SearchOrder:=xlByRows, SearchDirection:=xlPrevious).Row).Value = ActiveSheet.Name
Range("A1").Select
Selection.CurrentRegion.Select
Selection.Offset(1, 0).Resize(Selection.Rows.Count - 1).Select
Selection.Copy Destination:=Sheets(1).Range("A65536").End(xlUp)(2)
ActiveSheet.Columns("A").EntireColumn.Delete
Next
End Sub