• 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.

sum

webmax

Member
Hi

In the workbook i have Output sheet and Sheet 2 & Sheet3.

I want the sum total of the Sheet 2 & Sheet 3 to in the output file.

I tried but the total is not working and not fill down. i am attaching the sheet for your reference.


regards
Shahul
 

Attachments

  • sum across sheets.xls
    38.5 KB · Views: 9
Hi Shahul,

See the attached file with name manager.

This will work if structure remain same in all sheet.

Regards,
 

Attachments

  • sum across sheets.xls
    33.5 KB · Views: 2
@webmax,

You can simply Consolidate Data (since layout of your data in consistent).. [Data>Consolidate>Select Ranges in Two Sheets>Sum>Done]
 
Hi Shahul..

You are in the right track.. ;) just a lil modification.. :)

Sub sumsheets()
Dim ssum As Double
For j = 2 To ActiveWorkbook.Sheets.Count
Sheets("output").Range("B2").Value = Sheets("output").Range("B2").Value + WorksheetFunction.Sum(Worksheets(j).Range("B2:B2"))
Next j
End Sub

But still needs a lot of modification.. :) Did you ever think.. what happen if you run the code.. more than once..!!!
 
Hi Shahul ,

Your requirement is such that there are two variables :

1. The sheets which need to be considered for the sum

2. The cells which need to be summed up

In a formula , both can be specified ; in a function , at least one can be specified.

If you want a subroutine , then both of the above will have to be hard-coded within the subroutine , and each time you add a month or you add a new sheet , you will have to make the changes within the code. Is this acceptable ?

Narayan
 
Back
Top