• Hi All

    Please note that at the Chandoo.org Forums there is Zero Tolerance to Spam

    Post Spam and you Will Be Deleted as a User

    Hui...

  • When starting a new post, to receive a quicker and more targeted answer, Please include a sample file in the initial post.

VBA for Report Summary

Hi Experts!


I have a report in which I need a summary on the very bottom. Report range may vary. I have done a sample macro to find the totals but I am not able to integrate another summary below the result. I have attached a sample file for your better understanding.

Can anyone help me in this regards,

Thanks in Advance!
 

Attachments

  • Sample Test.xlsm
    25.3 KB · Views: 3
Hi ,

Something like this ?

Narayan[/quote

Yes! How ever when i changed the range of the report.

Just tried to increase the range and when I run the macro
* Sum, Count & Averages are not picking the right range
* Formula not appearing on AP9:AP12
* Formula not appearing on AQ11

I have attached the file for your review.

Many thanks for the quick support
 

Attachments

  • Sample Test (1).xlsm
    26 KB · Views: 1
I tried with the following code and it works on the dynamic range. 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!

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
 
Back
Top