Beruflich Dokumente
Kultur Dokumente
Excel macro that allows you to select multiple workbooks and have all of their worksheets
automatically combined into a single workbook.
This macro will add the worksheets to a newly created workbook and not to the currently
open/visible workbook. This allows you to do whatever you want with the new workbook without
having to worry about the contents of the current workbook.
This macro allows you to select as many files as you want to combine and you do it all through the
regular "Select File" dialogue box, which makes it really easy to use.
You do not have to change anything for this macro to work, just run it.
Select All
Sub Combine_Workbooks_Select_Files_1()
With Application
CalcMode = .Calculation
.Calculation = xlCalculationManual
.ScreenUpdating = False
.EnableEvents = False
.DisplayAlerts = False
End With
'Get the files to combine
If IsArray(FName) Then
On Error GoTo 0
wSheet.Move Before:=BaseWb.Sheets(1)
Next wSheet
mybook.Close savechanges:=False
On Error GoTo 0
End If
Next Fnum
BaseWb.Sheets(BaseWb.Sheets.Count).Delete
End If
ExitTheSub:
With Application
.ScreenUpdating = True
.EnableEvents = True
.Calculation = CalcMode
.DisplayAlerts = True
End With
End Sub