VBA excel SUMPRODUCT/SUMIF/INDIRECT formula equivalent or other option needed to collate and summarise worksheet data from across 3 workbooks?

1Thess521

New Member
Joined
May 26, 2020
Messages
2
Office Version
  1. 365
Platform
  1. Windows
Is there a VBA option to do the same thing an excel SUMPRODUCT(SUMIF(INDIRECT)) formula does but that dynamically works with a changing number of worksheet names...or better still...is there a way to code/send/call 10 sheets from 1 workbook and 1 sheet from a 2nd workbook onto a 3rd workbook and collate everything based on the unique identifier that is common to all worksheets within all 3 workbooks?

I've been self-learning VBA for 6 months and enjoying myself immensely, but I'm currently trying to automate a Payroll Summary and have a snag that I have not been able to solve in 8 days of trying ?

I have 1 workbook of 52+ tabs, Sheet Names mainly LongDates corresponding to every Sunday in the UK tax year (used for weekly time sheet input). A 2nd workbook has 12+ tabs, with the sheet names mainly Mmm months (used for monthly expenses input). Both workbooks have a couple of additional sheets containing employee information and both are populated via UserForms which work fine (yay)

A 3rd 'Summary' workbook has 12+ tabs and MMM month Sheet Names and corresponding column headers to the other 2 workbooks.

I am trying to find a way to collate the respective values for each person from specific sheets on the other two workbooks as a summary for each month.
Each time sheet has 4 column values that need to feed into one summary month and a further 6 column values that need to feed into a different summary month, so each month I need to access 10 different time sheet worksheets and one expense worksheet.

Unable to find a way to collate directly to/from my Summary workbook I eventually found the following formula: =SUMPRODUCT(SUMIF(INDIRECT("'"&HRSshtList&"'!B3:B60"),M5,INDIRECT("'"&HRSshtList&"'!E3:E60"))).
This I placed on a worksheet within the 52+ tab workbook and it works fine when a fixed named range list or fixed table is used, but it won't work with a dynamically changing named range or table.
A coded 'Run' button updates the respective weeks when clicked...and all my efforts to then put those updated week dates into a dynamic named range (using OFFSET) or into a table has created #REF across the formula cells.

I am completely stuck and would be so grateful for any help anyone can offer...many thanks in advance...and in retrospect of all the help I've gleaned from you all so far too.
 

Excel Facts

Can a formula spear through sheets?
Use =SUM(January:December!E7) to sum E7 on all of the sheets from January through December
Still struggling to find a solution...anyone got any ideas how I might achieve the objective of a summary of values from 11 worksheets that change monthly?
 
Upvote 0

Forum statistics

Threads
1,223,911
Messages
6,175,325
Members
452,635
Latest member
laura12345

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