ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   need help populating a totals sheet (https://www.excelbanter.com/excel-programming/380745-re-need-help-populating-totals-sheet.html)

[email protected]

need help populating a totals sheet
 
I would go with something like this:

Dim objWorksheet As Worksheet

For Each objWorksheet In ActiveWorkbook.Worksheets
'Put your totaling code here
Next objWorksheet


This code loops through every worksheet in the current workbook
regardless of its name.


phil-rge-ee wrote:
I have a workbook that has a separate sheet for everyday we work in each
month. Each sheet is named in this date format: 010207 and 010307 and 010407,
etc. There is also a totals sheet as well. On the totals sheet it pulls data
from all the other sheets and totals them up.
Right now I'm using as an example this formula to total certain column /cells:
=IF('010207'!B2=1,1,0)+IF('010307'!B2=1,1,0)+IF('0 10407'!B2=1,1,0)
I use this formula format to total the data from all the sheets, usually
about 20 sheets per month.

Is there a way to use some formula, marco, or VB script to automate this a
bit. Something that will scan each sheet no matter what the sheet name is and
pull the cell info over? It's a pain to keep changing the formulas when the
sheet names change for the different months.
Thanks for any help you can provide.

Phil




All times are GMT +1. The time now is 05:33 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com