VBA Sum all worsksheets in column T

Weeble

Board Regular
Joined
Nov 30, 2016
Messages
95
Office Version
  1. 365
Heya !

I have a pretty big excel file with aprox 60 worksheets. In every sheet column T has aprox 1000-4000 rows of data.
How would be the easiest way to summarise this data into a "summary-sheet" ?
There is alot of blank spaces in column T aswell if that might be an issue?
 

Excel Facts

Who is Mr Spreadsheet?
Author John Walkenbach was Mr Spreadsheet until his retirement in June 2019.
what are the worksheet names? are they a sequence or completely random?
 
Upvote 0
They are quite random. It's 52 weeks, with name of months and such.
 
Upvote 0
so you'd like a summary sheet with each sheet name and a value for column T beside it?
 
Upvote 0
The only thing I need is the total sum of all sheets in one cell. No need for sheet name.
 
Upvote 0
Make a list of the worksheet names in a new sheet lets say from A1:A60 then put the below in A1 and drag down.

=SUM(INDIRECT("'"&A2&"'!T:T"))
 
Upvote 0
The only thing I need is the total sum of all sheets in one cell. No need for sheet name.

right youll need a named range with all your sheet names then and the use sum with sumproduct
 
Upvote 0
create a list f all of your sheets. Then add them to a named range , Lets call it SHTS. then use the below formula

=SUMPRODUCT(SUM(INDIRECT("'"&SHTS&"'!T:T")))
 
Upvote 0
The only thing I need is the total sum of all sheets in one cell. No need for sheet name.
Here is a UDF (user defined function) that should give you that total...
Code:
Function TotalColT() As Double
  Dim WS As Worksheet
  For Each WS In ThisWorkbook.Worksheets
    TotalColT = TotalColT + Application.Sum(WS.Range("T:T"))
  Next
End Function

HOW TO INSTALL UDFs
------------------------------------
If you are new to UDFs, they are easy to install and use. To install it, simply press ALT+F11 to go into the VB editor and, once there, click Insert/Module on its menu bar, then copy/paste the above code into the code window that just opened up. That's it.... you are done. You can now use TotalColT just like it was a built-in Excel function. For example,

=TotalColT()

If you are using XL2007 or above, make sure you save your file as an "Excel Macro-Enabled Workbook (*.xlsm) and answer the "do you want to enable macros" question as "yes" or "OK" (depending on the button label for your version of Excel) the next time you open your workbook.
 
Last edited:
Upvote 0

Forum statistics

Threads
1,214,427
Messages
6,119,419
Members
448,895
Latest member
omarahmed1

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