Looping Macro Help!

KHughes687

New Member
Joined
May 4, 2010
Messages
2
<TABLE width="100%"><TBODY><TR><TD>
I have a spreadsheet that has multiple rows for the same date (Col A), each with different product data in cols B-M.
I need to be able to read through each row until the date changes (the number of rows changes each day). Whilst the date matches I need to add the contents of cell B on each row to a total. Once the total for Col B has been gathered I need it written into a cell on another sheet.
I need this to happen for each of columns B-M so that I end up with a totals worksheet.
Each row on this sheet is a unique date in Col A, with totals for columns B, C, etc in the rest of the columns of the row. I also need the script to then continue to do this for all the rows in the original sheet, so that the 2nd sheet ends up with a list of unique dates and totals for each day.
Any ideas gratefully received...!:eek:



</TD></TR></TBODY></TABLE>
 

Excel Facts

Excel Joke
Why can't spreadsheets drive cars? They crash too often!
A Pivot Table should work. Example (only a few columns shown)

Excel Workbook
ABCD
1DateBCD
204/05/2010092
304/05/2010658
404/05/2010020
505/05/2010309
605/05/2010291
705/05/2010709
806/05/2010156
906/05/20101076
1006/05/2010049
1106/05/2010789
1206/05/2010642
Raw Data



Excel Workbook
ABCD
3Values
4Row LabelsSum of BSum of CSum of D
504/05/201061610
605/05/201012919
706/05/2010242832
8Grand Total425361
Pivot
 
Upvote 0
Thanks VoG. I'll give that a go. Someone else has just pointed out I could have used a simple SUMIF formula too! I think I just need to go home and have a lie down and forget about today!

Thanks again. Appreciate the fast response.:)
 
Upvote 0

Forum statistics

Threads
1,215,217
Messages
6,123,673
Members
449,116
Latest member
HypnoFant

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top