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
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:
Microsoft Excel topics include formulas, formatting, VBA macros and user-defined functions, and everything else related to the spreadsheet user interface, including error messages.
Then, on another worksheet, use formulas to pull in the grand totals, such as:
=SUM(Table1[MyValueColumnN
=SUM(Table2[MyValueColumnN
=SUM(Table3[MyValueColumnN
etc.
If you have the name of the table in, say, Col A, you can use:
=SUM(INDIRECT(A1&"[MyValue