Need a macro to sum range of cells

Closed
gtsellos Posts 3 Registration date Sunday January 27, 2013 Status Member Last seen January 29, 2013 - Jan 27, 2013 at 04:30 AM
rizvisa1 Posts 4478 Registration date Thursday January 28, 2010 Status Contributor Last seen May 5, 2022 - Jan 29, 2013 at 09:45 PM
Hello,
I am a teacher from Greece and I want your help to gather information and sum from different worksheets in different workbooks to another for all the schools.
I have 11 workbooks each one has 1 worksheet (all in the same format and the same name) with data for the students-classes. I want to copy all these worksheets named"G1" to another new workbook named "general total".
After that I want to take specific range of cells from each one worksheet and have the sum of them to a new worksheet names "total".
explain:From each worksheet named"G1" I want the range of cells B12...B17, C12...C17, K22...K24, and the cells D18,G18,P17. The sum of these cells I want to put in the same cells in the workshhet "total".
Please send me a macro or any other possible answer.
It is my first time (I regisered to the forum just now) and I am sorry if my Engish is not very good. Any solution is very welcomed.
Thank you all.

2 responses

rizvisa1 Posts 4478 Registration date Thursday January 28, 2010 Status Contributor Last seen May 5, 2022 766
Jan 27, 2013 at 10:03 AM
Hello. Some additional information is needed.

A . First issue is identification of those 11 workbooks

1. These 11 workbook, are they in same folder/directory?

2. If they are in same directory, do you plan to open every *.xls* file in that directory and copy it into new workbook.

3. If there are other *.xls* files in that directory, how one can identify which 11 books to open

B. Second issue is the naming of the sheets as they get copied into new workbook. What names you would be giving to those sheets, since you cannot have more than one sheet with same name

May be if you could upload a sample files it would be more easy to see what can be done. This workbook would have the copied data into new sheet and then the total sheet. You dont need to have whole information, just sample to show how things would be. If you create a sample workbook, post it on some public file share site like speedyshare.com and post back link to the ACTUAL FILE back here.
0
gtsellos Posts 3 Registration date Sunday January 27, 2013 Status Member Last seen January 29, 2013
Jan 28, 2013 at 12:24 PM
At first, thank you very much for answering to my request.
1.the 11 workbooks are in the same folder named "statistics" and they have different name. The only same name is the name of the worksheet included "G1".
2. I shall copy the worksheets invluded into a new workbook named "master".
3. I shall rename them as "G1", "G2", 'G3" and so on.
The only thing I want to help me is to gather the sum of the range of the cells: B12...B17, C12...C17, K22...K24, and the cells D18,G18,P17 to a worksheet named "total" using a macro to do that quickly.
Thank you very much for your help. I hope that I made you understand my problem.
Is there any chance to gather all these 11worksheets into one (copy) and rename them at the same time using a command macro?
0
rizvisa1 Posts 4478 Registration date Thursday January 28, 2010 Status Contributor Last seen May 5, 2022 766
Jan 29, 2013 at 07:02 AM
gtsellos : "Is there any chance to gather all these 11worksheets into one (copy) and rename them at the same time using a command macro?"

That what i thought you initially wanted/ Let macro copy the sheets into new workbook and then combine them all and hence all those questions that i asked at https://ccm.net/forum/affich-685553-need-a-macro-to-sum-range-of-cells#1
0
gtsellos Posts 3 Registration date Sunday January 27, 2013 Status Member Last seen January 29, 2013
Jan 29, 2013 at 11:37 AM
Can you send me this macro command?
0
rizvisa1 Posts 4478 Registration date Thursday January 28, 2010 Status Contributor Last seen May 5, 2022 766
Jan 29, 2013 at 09:45 PM
May be if you could upload a sample files it would be more easy to see what can be done. This workbook would have the copied data into new sheet and then the total sheet. You dont need to have whole information, just sample to show how things would be. If you create a sample workbook, post it on some public file share site like speedyshare.com and post back link to the ACTUAL FILE back here.
0