+ Reply to Thread
Results 1 to 7 of 7

Macro to create Summary from 2 Sheets as per Months in Col D and criteria in Col M

  1. #1
    Forum Contributor
    Join Date
    12-26-2015
    Location
    UAE
    MS-Off Ver
    2013
    Posts
    128

    Macro to create Summary from 2 Sheets as per Months in Col D and criteria in Col M

    Hello All,

    I have excel 2013
    There are 3 sheets

    Sheet1, Sheet2 and Summary

    Data Starts from Row 12 on Sheet1 and Sheet2 (as shown in the sample attached)

    I want a macro which when run should add values of Col I from both Sheet1 and Sheet2 corresponding to the Values in Col M (both highlighted in yellow color for explanation purpose) according to the Months in Col D on both Sheet1 and Sheet2

    Currently I filter Col D by months and then filter Col M as per each values P,D,C and B then add them manually on the Summary Sheet

    Col M on Sheet1 and Sheet2 is updated every other day so blanks in Col M should not be considered

    Any help would be appreciated

    Thanks in advance
    Rehana
    Attached Files Attached Files
    Last edited by rehana402003; 07-19-2018 at 05:57 AM.

  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 ‼


    As a beginner starter :

    PHP Code: 
    Sub Demo1()
            
    Dim WC@(), N%, R&, VM%
        
    With Worksheets("Summary")
                
    = .Range("A4", .[A4].End(xlDown)(0)).Value
                ReDim C
    (1 To UBound(W), 1 To 12)
            For 
    1 To 2
                With Worksheets
    (N).[A12].CurrentRegion
                    
    For 2 To .Rows.Count
                            V 
    Application.Match(RTrim(.Cells(R13).Value), W0)
                        If 
    IsNumeric(VThen
                            M 
    Month(.Cells(R4).Value)
                            
    C(VM) = C(VM) + .Cells(R9).Value
                        End 
    If
                    
    Next
                End With
            Next
                
    .[B4:M4].Resize(UBound(W)).Value C
        End With
    End Sub 
    Do you like it ? So thanks to click on bottom left star icon « Add Reputation » !

  3. #3
    Forum Contributor
    Join Date
    12-26-2015
    Location
    UAE
    MS-Off Ver
    2013
    Posts
    128

    Re: Hi ! Try this ‼

    Dear Marc
    Thanks for the prompt reply.
    I will test and revert back

    Regards
    Last edited by rehana402003; 07-19-2018 at 05:56 AM. Reason: Solved

  4. #4
    Forum Contributor
    Join Date
    12-26-2015
    Location
    UAE
    MS-Off Ver
    2013
    Posts
    128

    Re: Macro to create Summary from 2 Sheets as per Months in Col D and criteria in Col M

    Hello Marc,
    Thanks for the code
    Works like a charm
    Post marked Solved, reputation added

    Regards

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

    Re: Macro to create Summary from 2 Sheets as per Months in Col D and criteria in Col M


    Thanks for the rep' ! (to all)

    To Yasser : there is nothing magic as it's just about mixing Excel basics & a child level logic …

  6. #6
    Forum Expert
    Join Date
    04-23-2009
    Location
    Matrouh, Egypt
    MS-Off Ver
    Excel 2013
    Posts
    6,882

    Re: Macro to create Summary from 2 Sheets as per Months in Col D and criteria in Col M

    Your magic is in simplicity and power at the same time
    Nice coding Mr. Marc
    < ----- Please click the little star * next to add reputation if my post helps you
    Visit Forum : From Here

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

    Talking


    Thanks Yasser !

    ★ ★

+ 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. Create summary of three different sheets
    By esbencito in forum Excel General
    Replies: 17
    Last Post: 05-11-2018, 01:18 PM
  2. create a summary sheet based on the criteria from two diifferent sheets
    By manojuasc in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 02-20-2016, 01:30 PM
  3. Replies: 6
    Last Post: 06-05-2014, 04:40 AM
  4. Replies: 2
    Last Post: 09-19-2013, 04:22 AM
  5. Replies: 2
    Last Post: 04-16-2013, 06:17 AM
  6. Create a summary from multiple sheets on a master/summary sheet
    By detribus in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 09-07-2012, 08:04 PM
  7. [SOLVED] Create Summary Sheets
    By [email protected] in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 07-31-2006, 05:53 PM

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