Just James,
With your titles in row 1, beginning in cell A1.
I am using columns I thru M for the summary area.
Please TEST this FIRST in a COPY of your workbook (always make a backup copy before trying new code, you never know what you might lose).
1. Copy the below code, by highlighting the code and pressing the keys CTRL + C
2. Open your workbook
3. Press the keys ALT + F11 to open the Visual Basic Editor
4. Press the keys ALT + I to activate the Insert menu
5. Press M to insert a Standard Module
6. Where the cursor is flashing, paste the code by pressing the keys CTRL + V
7. Press the keys ALT + Q to exit the Editor, and return to Excel
8. To run the macro from Excel, open the workbook, and press ALT + F8 to display the Run Macro Dialog. Double Click the macro's name to Run it.
Option Explicit
Sub CreateSummary()
' stanleydgromjr, 04/27/2011
' http://www.excelforum.com/excel-general/773864-summarizing-data.html
Dim LR As Long, a As Long
Application.ScreenUpdating = False
Columns("I:M").Clear
Columns("A:C").AdvancedFilter Action:=xlFilterCopy, CopyToRange:=Range("I1"), Unique:=True
Range("I1:M1") = [{"Invoice","Job","CC","Amount","Time"}]
LR = Cells(Rows.Count, "I").End(xlUp).Row
With Range("L2:L" & LR)
.Formula = "=SUMIFS(F:F,A:A,I2,B:B,J2,C:C,K2)"
.NumberFormat = "#,##0.00"
End With
With Range("M2:M" & LR)
.Formula = "=SUMIFS(G:G,A:A,I2,B:B,J2,C:C,K2)"
.NumberFormat = "#,##0.0"
End With
Columns("I:M").AutoFit
Application.ScreenUpdating = True
End Sub
Before you run the macro, save your workbook, Save As, a macro enabled workbook with the file extionson .xlsm
Then run the CreateSummary macro.
Bookmarks