Macro for completing workbook update

M

Mike

I have a workbook with a summary sheet and a sheet for each month. Daily I
enter in information on promised jobs for particular accounts (late, early,
on time...). As I enter this data, all my functions do their thing and
update my monthly and yearly summaries. I recently added some
functions/formulas in an area that has 5 columns x 2000 rows; each cell with
a similar formula to:

=SUMPRODUCT(('April 2008'!$C$15:$C$659=$E38)*('April
2008'!$G$15:$G$659>0))+SUMPRODUCT(('May 2008'!$C$15:$C$659=$E38)*('May
2008'!$G$15:$G$659>0))+SUMPRODUCT(('June 2008'!$C$15:$C$659=$E38)*('June
2008'!$G$15:$G$659>0))+SUMPRODUCT(('July 2008'!$C$15:$C$659=$E38)*('July
2008'!$G$15:$G$659>0))+SUMPRODUCT(('August 2008'!$C$15:$C$659=$E38)*('August
2008'!$G$15:$G$659>0))+SUMPRODUCT(('September
2008'!$C$15:$C$659=$E38)*('September
2008'!$G$15:$G$659>0))+SUMPRODUCT(('October
2008'!$C$15:$C$659=$E38)*('October
2008'!$G$15:$G$659>0))+SUMPRODUCT(('November
2008'!$C$15:$C$659=$E38)*('November
2008'!$G$15:$G$659>0))+SUMPRODUCT(('December
2008'!$C$15:$C$659=$E38)*('December 2008'!$G$15:$G$659>0))

This particular one I use to count how many jobs a particular account has
received after their requested date. Since I added this my data entry has
slowed down tremendously due to what I can only assume is far too many
calculations. Is there a way to record a macro that will tell all my
calculations to 'start' after I enter all the data in? That way I can walk
away after I am done and let it update. The other possibility is maybe a
simpler formula. Not quite sure. Any help would be appreciated.
 
D

Don Guillett

Without seeing your wb it's hard to tell but here is one I sent out recently
that should do what you need. Modify to suit. Perhaps you could have had all
on ONE sheet with a date column. Then simply use filters.

Sub sumemeup()
lr = Sheets("summary").Cells(Rows.Count, "a").End(xlUp).Row
For Each c In Sheets("Summary").Range("a2:a" & lr)
For Each ws In ActiveWorkbook.Worksheets
If ws.Name <> "Summary" Then
ms = ms + Application. _
SUMIF(ws.Columns("a"), c, ws.Columns("e:e"))
End If
Next ws
c.Offset(, 1) = ms
Next c
End Sub
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top