Originally Posted by
jchapman1964
I am sure that is what I need to do, but how do I get this to happen when I click on print? It needs to be done ideally so that a sum of a column is placed in the footer? understand this can be done through VBA but not being an expert.......??J
I meant add it to the worksheet... but if you want it in the footer, then try
Private Sub Workbook_BeforePrint(Cancel As Boolean)
With ActiveSheet
If .Name = "Sheet1" Then
.PageSetup.LeftFooter = "Total = " & _
Application.Sum(Range("A:A"))
End If
End With
End Sub
This is workbook event code. 'To input this code, right click on the Excel icon on the worksheet (or next to the File menu if you maximise your workbooks), select View Code from the menu, and paste the code