Visual Basic for Applications script to merge multiple .xlsx files generated from D365 > Project Management and Accounting > Enquiries and Reports > Moody Project Report
In Excel, use Alt + F11 to invoke the Visual Basic for Applications tool, and use Alt + F8 to run the script.
The script is made up of three parts:
part 1 imports the multiple Excel files into separate worksheets in a single Excel file,
part 2 renames each sheet based on the list of names found in the ‘List’ worksheet and subsequently moves the ‘Summary’ sheet from last to first position in the Workbook,
and part 3 deletes the ‘List’ sheet
The file can then be Saved As an ordinary XLSX file.
PART 1 – MERGE FILES
VBA_MergeFiles
PART 2 – RENAME SHEETS
VBA_RenameSheets
PART 3 – DELETE LIST SHEET
VBA_DeleteListSheet
COMBINED VBA SCRIPT
VBA_CombinedScripts
DOWNLOAD XLSM FILE
https://www.moodydirect.com/resources/Master.xlsm
In Excel, use Alt + F11 to invoke the Visual Basic for Applications tool, and use Alt + F8 to run the script.
The script is made up of three parts:
The file can then be Saved As an ordinary XLSX file.
PART 1 – MERGE FILES
VBA_MergeFiles
PART 2 – RENAME SHEETS
VBA_RenameSheets
PART 3 – DELETE LIST SHEET
VBA_DeleteListSheet
COMBINED VBA SCRIPT
VBA_CombinedScripts
DOWNLOAD XLSM FILE
https://www.moodydirect.com/resources/Master.xlsm
Moody Project Report (VBA)
