+ Reply to Thread
Results 1 to 6 of 6

Summary Totals

  1. #1
    Registered User
    Join Date
    02-23-2014
    Location
    Qatar
    MS-Off Ver
    Excel 2010
    Posts
    73

    Summary Totals

    Dear Experts!

    I am trying to develop a macro to get the summary on the very bottom of my report. The range of report may vary. I have attached the sample file for better understanding.

    Thanks in Advance!
    Attached Files Attached Files

  2. #2
    Forum Contributor tax112's Avatar
    Join Date
    02-28-2013
    Location
    Thailand
    MS-Off Ver
    Excel 2016 | 2019
    Posts
    438

    Re: Summary Totals

    Quote Originally Posted by Paul Cherian View Post
    Dear Experts!

    I am trying to develop a macro to get the summary on the very bottom of my report. The range of report may vary. I have attached the sample file for better understanding.

    Thanks in Advance!
    Try:
    PHP Code: 
    Sub Fil_formula()
        
    Dim LR As Long
        LR 
    Range("K" Rows.Count).End(xlUp).Row
        Range
    ("K" LR 1).Resize(, 31).Formula "=SUM(K4:K" LR ")"
        
    Range("K" LR 2).Resize(, 31).Formula "=COUNT(K4:K" LR ")"
        
    Range("K" LR 3).Resize(, 31).Formula "=Average(K4:K" LR ")"
    End Sub 

  3. #3
    Registered User
    Join Date
    02-23-2014
    Location
    Qatar
    MS-Off Ver
    Excel 2010
    Posts
    73

    Re: Summary Totals

    Thanks!!! Tried with your code. However, the formulas on the "AP" and "AQ" are not appearing. In addition, Can you please try to fix the Names and formats (Borderlines) for the summary as provided on the result sheet?

    Thanks again to look into my request!

  4. #4
    Registered User
    Join Date
    02-23-2014
    Location
    Qatar
    MS-Off Ver
    Excel 2010
    Posts
    73

    Re: Summary Totals

    Its fine.. Got the coding for the remaining. Many thanks for your kind effort and time!

    Please Login or Register  to view this content.

  5. #5
    Forum Contributor tax112's Avatar
    Join Date
    02-28-2013
    Location
    Thailand
    MS-Off Ver
    Excel 2016 | 2019
    Posts
    438

    Re: Summary Totals

    Quote Originally Posted by Paul Cherian View Post
    Thanks!!! Tried with your code. However, the formulas on the "AP" and "AQ" are not appearing. In addition, Can you please try to fix the Names and formats (Borderlines) for the summary as provided on the result sheet?

    Thanks again to look into my request!
    Your data is in the form of text, so to calculate, must convert to numeric.
    You use Code

    PHP Code: 
    Sub Test()
        
    Dim Rng As Range
        Dim cel 
    As Range
        Set Rng 
    Range("K4:AO6")
        
    On Error Resume Next
        Application
    .ScreenUpdating False
        Rng
    .NumberFormat "General"
        
    For Each cel In Rng
            cel
    .Value cel.Value 1
        Next cel
        Application
    .ScreenUpdating True
    End Sub 
    Then you run the code:
    PHP Code: 
    Sub Fil_formula()
        
    Dim LR As Long
        LR 
    Range("K" Rows.Count).End(xlUp).Row
        Range
    ("K" LR 1).Resize(, 31).Formula "=SUM(K4:K" LR ")"
        
    Range("K" LR 2).Resize(, 31).Formula "=COUNT(K4:K" LR ")"
        
    Range("K" LR 3).Resize(, 31).Formula "=Average(K4:K" LR ")"
        
    With Range("AP4:AP" LR)
            .
    Value "=SUM(RC[-31]:RC[-1])"
            
    .Resize(LR 1).FillDown
        End With
    End Sub 

  6. #6
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2405 (Windows 11 23H2 64-bit)
    Posts
    81,428

    Re: Summary Totals

    Rule 08: Cross-posting Without Links

    Your post does not comply with Rule 8 of our Forum RULES. Do not cross-post your question on multiple forums without including links here to the other threads on other forums.

    Cross-posting is when you post the same question in other forums on the web. The last thing you want to do is waste people's time working on an issue you have already resolved elsewhere. We prefer that you not cross-post at all, but if you do (and it's unlikely to go unnoticed), you MUST provide a link (copy the url from the address bar in your browser) to the cross-post.

    Expect cross-posted questions without a link to be closed and a message will be posted by the moderator explaining why. We are here to help so help us to help you!

    Read this to understand why we ask you to do this, and then please edit your first post to include links to any and all cross-posts in any other forums (not just this site).

    No further help to be offered, please, until the OP has complied with this request.
    Ali


    Enthusiastic self-taught user of MS Excel who's always learning!
    Don't forget to say "thank you" in your thread to anyone who has offered you help.
    You can reward them by clicking on * Add Reputation below their user name on the left, if you wish.

    Forum Rules (updated August 2023): please read them here.

+ 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. Summary Sheet averaging totals
    By Crackerdaq in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 11-28-2014, 09:43 AM
  2. Sheet summary totals
    By Hugodey in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 04-03-2013, 06:42 AM
  3. Summary Totals By Data Type
    By danmcampbell in forum Excel General
    Replies: 1
    Last Post: 04-08-2012, 03:19 PM
  4. Creating summary totals
    By Gazzr in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 02-25-2008, 03:19 AM
  5. Copy totals to new cells at top for summary
    By mrdata in forum Excel General
    Replies: 2
    Last Post: 02-12-2007, 08:09 PM
  6. [SOLVED] Daily Totals on a summary sheet
    By Allewyn in forum Excel Formulas & Functions
    Replies: 10
    Last Post: 06-27-2006, 11:50 AM
  7. Summary Sheet Totals
    By gwhite in forum Excel General
    Replies: 3
    Last Post: 07-10-2005, 09:28 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