PDA

View Full Version : Macro that will consolidate multiple worksheets regardless of worksheet name



RneedofHelp
04-12-2016, 10:51 AM
I am attempting to set up a template workbook that will consist of multiple projects, each on its own worksheet using the same template (everything is consistence for each project worksheet)

I have been able to create a combined worksheet at the beginning which consolidates specific ranges from each project worksheet without a problem. I have attached this macro to a button so the end users simply clicks and updates that range of data. Allowing the user to manipulate individual project costs and then with one click updating the combined worksheet. My problem is that once the project worksheet tabs are re-labeled, the macro won’t work.

I am very new to Excel and have gotten this far but the forum’s on the web are over my head for something like this. I recorded the macro below and if anyone can help, it would be greatly appreciated!



Sub Consolidate_Exp()
'
' Consolidate_Exp Macro
'


'
Range("D36").Select
Selection.Consolidate Sources:=Array( _
"'S:\Investor Relations\Project Investor Workbook\[Project Investor Workbook - Multiple Site Project.xlsm]Site # 1'!R36C4:R83C16" _
, _
"'S:\Investor Relations\Project Investor Workbook\[Project Investor Workbook - Multiple Site Project.xlsm]Site # 2'!R36C4:R83C16" _
, _
"'S:\Investor Relations\Project Investor Workbook\[Project Investor Workbook - Multiple Site Project.xlsm]Site # 3'!R36C4:R83C16" _
, _
"'S:\Investor Relations\Project Investor Workbook\[Project Investor Workbook - Multiple Site Project.xlsm]Site # 4'!R36C4:R83C16" _
, _
"'S:\Investor Relations\Project Investor Workbook\[Project Investor Workbook - Multiple Site Project.xlsm]Site # 5'!R36C4:R83C16" _
, _
"'S:\Investor Relations\Project Investor Workbook\[Project Investor Workbook - Multiple Site Project.xlsm]Site # 6'!R36C4:R83C16" _
), Function:=xlSum, TopRow:=False, LeftColumn:=False, CreateLinks:= _
False
Range("I3").Select
End Sub