+ Reply to Thread
Results 1 to 4 of 4

Macro to Filter and Sum

  1. #1
    Forum Contributor
    Join Date
    11-17-2015
    Location
    India
    MS-Off Ver
    2013
    Posts
    365

    Macro to Filter and Sum

    Hi,

    I have a records in Sheet “data”. The number of records may differ data to data. Hence final row of the data to be considered the last number mentioned in column “A”. Here last record is row number 1618.

    I need macro to prepare two reports as mentioned in the attachment i.e. Report -2(Including Parents) and Report -3(Excluding Parents). At present I am making these reports manually

    In Sheet “Report -1(Only Self)”
    Task -1:- I need to have list of all locations with number of location and total amount with serial number. As mentioned in column A to D. Total in last row. This list is after removing the “Rejected” from the Column Q(Status) and “Spouse”, “Children”, “Parents” from the Column M(Relationship)in sheet “Data”. i.e. We need to filter only “Self” in relationship and “Approved” and “Under Process” in Status.

    Task -2:- From the list, I have to create 1st table next to the list which is to be amount wise top 5 locations list. As per the table Column F to I and Row 1 to 8.

    Task -3:- From the list, I have to create 2nd table below the above table, which is to be break of number of Relation-wise number of location and total Amount. As per the table Column F to I and Row 10 to 12.


    In Sheet “Report -2(Including Parents)”
    Task -1:- I need to have list of all locations with number of location and total amount with serial number. As mentioned in column A to D. Total in last row. This list is after removing the “Rejected” from the Column Q(Status) in sheet “Data”.

    Task -2:- From the list, I have to create 1st table next to the list which is to be amount wise top 5 locations list. As per the table Column F to I and Row 1 to 8.

    Task -3:- From the list, I have to create 2nd table below the above table, which is to be break of number of Relation-wise number of location and total Amount. As per the table Column F to I and Row 10 to 16.

    Task -4:- I have to create 3rd table below the above table, which is to be break of Relation-wise number and Amount (but only from the top 5 accumulated locations.). As per the table Column F to I and Row 18 to 24. Total number of table 1st and 3rd should match

    In Sheet “Report -3(Excluding Parents)”
    Task -1:- I need to have list of all locations with number of location and total amount with serial number. As mentioned in column A to D. Total in last row. This list is after removing the “Rejected” from the Column Q(Status) and “Parents” from the Column M(Relationship) in sheet “Data”.

    Task -2:- From the list, I have to create 1st table next to the list which is to be amount wise top 5 locations list. As per the table Column F to I and Row 1 to 8.

    Task -3:- From the list, I have to create 2nd table below the above table, which is to be break of number of Relation-wise number of location and total Amount. As per the table Column F to I and Row 10 to 15.

    Task -4:- I have to create 3rd table below the above table, which is to be break of Relation-wise number and Amount (but only from the top 5 locations records.). As per the table Column F to I and Row 17 to 22. Total number of table 1st and 3rd should match.

    Request you to provide comment against each code so that i can try to learn VBA coding.
    Attached Files Attached Files

  2. #2
    Forum Expert dangelor's Avatar
    Join Date
    09-06-2011
    Location
    Indiana, USA
    MS-Off Ver
    365 Pro Plus
    Posts
    2,274

    Re: Macro to Filter and Sum

    Might I suggest cleaning up your data to eliminate blank columns and then use Pivot Tables to extract the information you need.

  3. #3
    Forum Contributor
    Join Date
    11-17-2015
    Location
    India
    MS-Off Ver
    2013
    Posts
    365

    Re: Macro to Filter and Sum

    in Pivot table i am not able to create 3rd table. can u help me on that?

  4. #4
    Forum Expert dangelor's Avatar
    Join Date
    09-06-2011
    Location
    Indiana, USA
    MS-Off Ver
    365 Pro Plus
    Posts
    2,274

    Re: Macro to Filter and Sum

    See attached file...


    Pivot - Break Up.gif
    Attached Files Attached Files

+ 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. Inserting filter into pivot table via macro errors if filter doesn't exist.
    By taylorsm in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 01-03-2018, 10:24 AM
  2. Macro to filter a pivot whilst looping through filter criteria in a variable list.
    By Alistairm88 in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 05-29-2015, 04:25 AM
  3. [SOLVED] I need formula or macro to filter a number of items from different tables at single filter
    By Karthikeyannb in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 11-05-2014, 11:04 AM
  4. Replies: 5
    Last Post: 12-19-2013, 06:58 AM
  5. Filter Macro (range contained in filter value)
    By antman10 in forum Excel Programming / VBA / Macros
    Replies: 9
    Last Post: 11-28-2010, 11:09 PM
  6. Advanced Filter Macro - Won't run the filter
    By dsil in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 06-18-2008, 11:59 AM
  7. [SOLVED] Need macro to filter, create tab on filter and copy/paste
    By Jen in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 05-02-2006, 11:50 AM

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