Summary Page

G

Guest

I was searching previous posts before posting my question and didn't find any
that addressed this specific situation.

I have a workbook with 10 sheets. All 10 sheets have code that totals up
column D and puts the sum at the bottom of the sheet. This sum is never
located in the same row as the report lengths vary each day. Is there a wayt
to create a summary sheet and list the totals from each sheet on the summary
page with VBA code rather thatn copy and paste them all on to the summary
page?

For example

Sheet titled "cards" has Sum in Column D, row 56
Sheet titled "checks" has sum in Column D row 66
Sheet Titled "cash" has sum in column D row 156.

The only common thread is the total on each sheet is the last text in Column
D on that sheet. Also the row number varies each day so my question is how
would I code to copy the last cell in Column D on the sheet titled Cards with
a sum total to sheet titled Summary into Cell B4, the same for sheet Checks
copy to cell B5 in Summary sheet and Cash to cell B6. Is this even possible.
Thanks
 
G

Guest

This will populate the "Summary" sheet with each sheets name in Column A and
Column D total in column B.

Sub totals()
Dim c As Integer
Dim sht As Worksheet

c = 4
For Each sht In ThisWorkbook.Sheets
If sht.Name <> "Summary" Then
With Sheets("Summary")
.Cells(c, 1).Value = sht.Name
.Cells(c, 2).Value = _
sht.Cells(Rows.Count, 4).End(xlUp).Value
End With
c = c + 1
End If
Next sht

End Sub

Hope this helps
Rowan
 
G

Guest

Good Morning Rowan,

I don't understand this code, where does it stipulate to pull the sum total
numbers from the last cell in each sheet in column D. I just want to
understand the code I use. Also can I just stipulate copying the sum totals
from some of my sheets, not all of them (call each sheet specifically).
Thanks a bunch for your help.

Joyce
 

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