I have expenses data in excel which I'd like someone to help me summarize it in a pivot style report ideally in VBA, which I could then link it to a button.
So I have attached an excel workbook, there's two sheets in them, Sheet1 contains the raw data and Sheet2 is the report layout/style I am looking to achieve.
The TRXN column in sheet 1 contains the transaction number which is split into multiple lines if it affects multiple categories.
According to your attachment a VBA beginner starter
like any Excel beginner activating the Macro Recorder and using manually Excel basics :
PHP Code:
Sub Demo1() Application.ScreenUpdating = False With Sheet1.UsedRange: .ClearOutline: .Clear: End With With Sheet2.UsedRange With .Rows("2:" & .Rows.Count).Columns V = "IF({1},SUMIF(" & .Item(3).Address(External:=True) & ",#," & .Item(8).Address(External:=True) & "))" End With .Range("A1:C1,G1:H1").Copy Sheet1.[C3] .AdvancedFilter xlFilterCopy, Empty, Sheet1.[C3:F3], True End With With Sheet1.[C3].CurrentRegion.Rows .Sort .Cells(4), xlAscending, Header:=xlYes .Range("E2:E" & .Count) = Evaluate(Replace(V, "#", .Range("C2:C" & .Count).Address(External:=True))) .Subtotal 4, xlSum, [{5}], False, False, xlSummaryAbove .Columns.AutoFit End With Application.ScreenUpdating = True End Sub
► Do you like it ? ► ► So thanks to click on bottom left star icon « ★ Add Reputation » ! ◄ ◄
Bookmarks