Macro on template workbook that will consolidate multiple worksheets regardless of worksheet name

RneedofHelp

New Member
Joined
Apr 12, 2016
Messages
1
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 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
 

Excel Facts

Which lookup functions find a value equal or greater than the lookup value?
MATCH uses -1 to find larger value (lookup table must be sorted ZA). XLOOKUP uses 1 to find values greater and does not need to be sorted.

Forum statistics

Threads
1,214,415
Messages
6,119,382
Members
448,889
Latest member
TS_711

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top