Skip to content

Instantly share code, notes, and snippets.

@Kyson
Created December 29, 2016 16:48
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 Kyson/e47b82f3bdfb47af1e13e97ca5e1d8d4 to your computer and use it in GitHub Desktop.
Save Kyson/e47b82f3bdfb47af1e13e97ca5e1d8d4 to your computer and use it in GitHub Desktop.
多个sheet合并一个sheet
Sub 合并当前工作簿下的所有工作表()
Application.ScreenUpdating = False
For j = 1 To Sheets.Count
If Sheets(j).Name <> ActiveSheet.Name Then
X = Range("A65536").End(xlUp).Row + 1
Sheets(j).UsedRange.Copy Cells(X, 1)
End If
Next
Range("B1").Select
Application.ScreenUpdating = True
MsgBox "当前工作簿下的全部工作表已经合并完毕!", vbInformation, "提示"
End Sub
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment