Skip to content

Instantly share code, notes, and snippets.

@ndthanh
Created June 25, 2017 04:47
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ndthanh/16a48e726b788528c31a17484bc7ee1b to your computer and use it in GitHub Desktop.
Save ndthanh/16a48e726b788528c31a17484bc7ee1b to your computer and use it in GitHub Desktop.
Sub Combine()
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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment