Avatar of donohara1
donohara1

asked on 

how to create Totals for the same column for all sheets in an Excel workbook. VBA

I have Excel workbooks that have a variable number of sheets. I would like to sum the same column in each sheet, and create a table (in a new sheet) that has the sheet name, total and number of values in 3 columns. There is no other numeric data in these columns
Microsoft Excel

Avatar of undefined
Last Comment
donohara1
Avatar of Patrick Matthews
Patrick Matthews
Flag of United States of America image

If you are using Excel 2007 or 2010, I would simple create Tables for your various worksheets, and then in Table Tools/Design ribbon tab, select Total Row in the Table Style Options to force a grand total row.

Then, on another worksheet, use formulas to pull in the grand totals, such as:

=SUM(Table1[MyValueColumnName])
=SUM(Table2[MyValueColumnName])
=SUM(Table3[MyValueColumnName])
etc.

If you have the name of the table in, say, Col A, you can use:

=SUM(INDIRECT(A1&"[MyValueColumnName]"))
ASKER CERTIFIED SOLUTION
Avatar of m4trix
m4trix
Flag of Canada image

Blurred text
THIS SOLUTION IS ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
Avatar of donohara1
donohara1

ASKER

Perfect.
Microsoft Excel
Microsoft Excel

Microsoft Excel topics include formulas, formatting, VBA macros and user-defined functions, and everything else related to the spreadsheet user interface, including error messages.

144K
Questions
--
Followers
--
Top Experts
Get a personalized solution from industry experts
Ask the experts
Read over 600 more reviews

TRUSTED BY

IBM logoIntel logoMicrosoft logoUbisoft logoSAP logo
Qualcomm logoCitrix Systems logoWorkday logoErnst & Young logo
High performer badgeUsers love us badge
LinkedIn logoFacebook logoX logoInstagram logoTikTok logoYouTube logo