Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!
Sub Append() Dim strFileSelected As String Dim objOfficeDialog As Object Dim wbDestination As Workbook Dim wbSource As Workbook Dim sh As Worksheet Application.DisplayAlerts = False Application.EnableEvents = False Application.ScreenUpdating = False Set objOfficeDialog = Application.FileDialog(msoFileDialogFilePicker) Set wbDestination = ActiveWorkbook With objOfficeDialog .Title = "Select the Project Cost Allocation file" .AllowMultiSelect = False If .Show <> -1 Then Exit Sub End If strFileSelected = .SelectedItems(1) End With Dim strSuffix As String If strFileSelected <> "" Then strSuffix = InputBox("Please enter text to append to tab names") Set wbSource = Workbooks.Open(strFileSelected) For Each sh In wbSource.Sheets sh.Copy After:=wbDestination.Worksheets(wbDestination.Worksheets.Count) wbDestination.Worksheets(wbDestination.Worksheets.Count).Name = sh.Name & " " & strSuffix Next sh wbSource.Close False End If Application.DisplayAlerts = True Application.EnableEvents = True Application.ScreenUpdating = True End Sub
Add your voice to the tech community where 5M+ people just like you are talking about what matters.
|Excel + CountIfs + two colums||5||33|
|Need macro to assign two digit numbers to selected cells in Excel 2016||3||29|
|Email Excel WB by selecting name from a dropdown list to Outlook.||5||37|
|Excel - IF criterion||2||18|
Join the community of 500,000 technology professionals and ask your questions.