Dim i As Long
Dim i2 As Long
i = 3
'Check to see if this is fresh.
Do While ThisWorkbook.Sheets("SUMMARY").Cells(i, 1).Value <> ""
i = i + 1
Loop
i2 = i
'Set's the starting row for summation
Dim ws As Worksheet
For Each ws In Worksheets
If ws.Name <> "SUMMARY" Then
ThisWorkbook.Sheets("SUMMARY").Cells(i, 1).Value = ws.Name
ThisWorkbook.Sheets("SUMMARY").Cells(i, 2).Formula = "='" & ws.Name & "'!D5"
i = i + 1
Else
End If
Next
ThisWorkbook.Sheets("SUMMARY").Cells(i, 1).Value = "TOTAL:"
ThisWorkbook.Sheets("SUMMARY").Cells(i, 2).Formula = "=sum(" & Cells(i2, 2).Address & ":" & Cells(i - 1, 2).Address & ")"
This will will check all the worksheets in your workbook, and put the reference
Bookmarks