+ Reply to Thread
Results 1 to 2 of 2

Summarize expenses data into report in VBA

  1. #1
    Registered User
    Join Date
    06-19-2011
    Location
    London, England
    MS-Off Ver
    Excel 2019
    Posts
    24

    Summarize expenses data into report in VBA

    Hi all,

    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.

    thanks & regards
    Attached Files Attached Files

  2. #2
    Forum Expert
    Join Date
    11-24-2013
    Location
    Paris, France
    MS-Off Ver
    Excel 2003 / 2010
    Posts
    9,831

    Cool Hi ! Try this demonstration !


    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), xlAscendingHeader:=xlYes
            
    .Range("E2:E" & .Count) = Evaluate(Replace(V"#", .Range("C2:C" & .Count).Address(External:=True)))
            .
    Subtotal 4xlSum, [{5}], FalseFalsexlSummaryAbove
            
    .Columns.AutoFit
        End With
             Application
    .ScreenUpdating True
    End Sub 
    ► Do you like it ? ► So thanks to click on bottom left star icon « Add Reputation » !

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. [SOLVED] Help - pick up data another worksheet, sum expenses, vlookup other sheet
    By pattyd89 in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 04-20-2017, 02:50 PM
  2. Need Formula to make expenses report to the week by date entered
    By Futurian21 in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 11-14-2016, 04:09 AM
  3. Replies: 1
    Last Post: 09-01-2013, 06:07 PM
  4. [SOLVED] vba editing assistance that rcm helped with to summarize a report
    By lilsnoop in forum Excel Programming / VBA / Macros
    Replies: 11
    Last Post: 01-07-2013, 05:52 PM
  5. Replies: 2
    Last Post: 06-29-2011, 04:35 PM
  6. Pull data from a matrix table into a report using 2 report conditions
    By bing in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 09-03-2008, 11:51 AM
  7. Replies: 0
    Last Post: 07-27-2005, 06:05 PM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1