Re: Generate Master Sheet
Some things to note in the code....the first part is just placing cell names into their appropriate place...the second part is placing a Sum into the individual says...just like you would do normally.
One other thing if you are going to change the sheet names then you MUST change them here as well...this is not an elegant way to write it but it is effective.
Sub Summary()
Sheets("Sheet1 (2)").Cells(2, 1).Value = "All Sections Total"
Sheets("Sheet1 (2)").Cells(1, 2).Value = "Monday"
Sheets("Sheet1 (2)").Cells(1, 3).Value = "Tuesday"
Sheets("Sheet1 (2)").Cells(1, 4).Value = "Wednesday"
Sheets("Sheet1 (2)").Cells(1, 5).Value = "Thursday"
Sheets("Sheet1 (2)").Cells(1, 6).Value = "Friday"
Sheets("Sheet1 (2)").Cells(1, 7).Value = "Saturday"
Sheets("Sheet1 (2)").Cells(2, 2).Formula = "=Sum(" & "'" & Sheets("Sheet1 (3)").Name & "'!" & Cells(2, 2).Address & ":" & "'" & Sheets("Sheet1 (3)").Name & "'!" & Cells(11, 2).Address & ")"
Sheets("Sheet1 (2)").Cells(2, 3).Value = "=Sum(" & "'" & Sheets("Sheet1 (3)").Name & "'!" & Cells(2, 3).Address & ":" & "'" & Sheets("Sheet1 (3)").Name & "'!" & Cells(11, 3).Address & ")"
Sheets("Sheet1 (2)").Cells(2, 4).Value = "=Sum(" & "'" & Sheets("Sheet1 (3)").Name & "'!" & Cells(2, 4).Address & ":" & "'" & Sheets("Sheet1 (3)").Name & "'!" & Cells(11, 4).Address & ")"
Sheets("Sheet1 (2)").Cells(2, 5).Value = "=Sum(" & "'" & Sheets("Sheet1 (3)").Name & "'!" & Cells(2, 5).Address & ":" & "'" & Sheets("Sheet1 (3)").Name & "'!" & Cells(11, 5).Address & ")"
Sheets("Sheet1 (2)").Cells(2, 6).Value = "=Sum(" & "'" & Sheets("Sheet1 (3)").Name & "'!" & Cells(2, 6).Address & ":" & "'" & Sheets("Sheet1 (3)").Name & "'!" & Cells(11, 6).Address & ")"
Sheets("Sheet1 (2)").Cells(2, 7).Value = "=Sum(" & "'" & Sheets("Sheet1 (3)").Name & "'!" & Cells(2, 7).Address & ":" & "'" & Sheets("Sheet1 (3)").Name & "'!" & Cells(11, 7).Address & ")"
End Sub
Display More