I've tried this code but doesn't seem to work, any pointers?
Please Login or Register to view this content.
I've tried this code but doesn't seem to work, any pointers?
Please Login or Register to view this content.
Last edited by Colin_S; 08-16-2010 at 05:23 AM.
It might be best if you tell us what you're trying to do.
The code you've posted is trying to work on the active selection, but if you're going to select all of the rows you want to sum then you're only saving yourself 6 keystroke by not just typing in =SUM().
I have a huge macro that takes 6 spreadsheets and pulls it into 1, adds formulas to work out data, formats it all, pulls it into a pivot table and produces 8 summary report tabs and a master summary. The final piece I need is to add totals at the bottom of 7 columns in the 8 summary tabs. Each tab will have a different number of rows on a regular basis.
What I am looking to do is get this small function working for 1 column, I will then basically paste it for each column required in each of the 8 summary tabs.
Last edited by Colin_S; 08-12-2010 at 10:51 AM.
OK, with you. Will there be the same number of rows in all 7 columns?
yes same in all 7 columns, I’ve got the code written to basically paste the formula into the other 6 columns once I get the first formula correct. And then replicate it over the other 8 tabs. The only issue I seem to be stuck at is how many rows to sum. If it was the same number of rows each time I’ve got it down, but as soon as the number of rows change it doesn’t work correct so I attempted my original code but I know it’s not correct.
Thanks
OK, try this.
It would be neater to pass the first row and the target column to the sub as parameters, but I'll leave it up to you to decide if you want to do that.Please Login or Register to view this content.
Perfect, just changed that first 6 to a 3 and it's bang on. Many thanks for you time and help.
If you wanted to use R1C1 style:
Please Login or Register to view this content.
Remember what the dormouse said
Feed your head
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks