Hi,
Just a newbie here, not really experienced in coding or such, instead I pulled a script from the internet to serve one purpose.
Which is to combine all the sheets in my excel file onto one single sheet where all the data will be collated. It works for some file, but at the same time, it doesn't for some, due to empty spaces in between, may I know if there is a solution to this?
Attached is my test file, any help is appreciated.
Code
Sub Combine()
'UpdatebyExtendoffice
Dim J As Integer
On Error Resume Next
Sheets(1).Select
Worksheets.Add
Sheets(1).Name = "Combined"
Sheets(2).Activate
Range("A1").EntireRow.Select
Selection.Copy Destination:=Sheets(1).Range("A1")
For J = 2 To Sheets.Count
Sheets(J).Activate
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)
Next
End Sub
Display More