Created
December 29, 2016 16:47
-
-
Save Kyson/dbe2c531b1fc6887df054b2acc1d192b to your computer and use it in GitHub Desktop.
excel合并sheet
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sub hebing() | |
Dim FileOpen | |
Dim X As Integer | |
Application.ScreenUpdating = False | |
FileOpen = Application.GetOpenFilename(FileFilter:="Microsoft Excel文件(*.xlsx),*.xlsx", MultiSelect:=True, Title:="合并工作薄") | |
X = 1 | |
While X <= UBound(FileOpen) | |
Workbooks.Open Filename:=FileOpen(X) | |
Sheets().Move After:=ThisWorkbook.Sheets(ThisWorkbook.Sheets.Count) | |
X = X + 1 | |
Wend | |
ExitHandler: | |
Application.ScreenUpdating = True | |
Exit Sub | |
errhadler: | |
MsgBox Err.Description | |
End Sub |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment