Best VBA combo--Loops, find, sum with formatting thrown in

Outofmycomfortzone

New Member
Joined
Jan 28, 2018
Messages
1
This is my first post. Thank you in advance for taking the time to assist me.

I have a formatting question that involves calculations. I have data with several columns, with the focus on 2 columns, namely the 3rd column ("C") and the 8th column ("H").

Column "C" has repeating values and column "H" has their corresponding totals. I need to total the sums of the values that are found in column "C" at the end of the data (number of rows vary from time to time), numerically in their order as they may appear with a slight variation in the format.

The values in "C" can be 11,12,14,21,23. They may not always be inputted but I need to make sure they are checked if periodically inputted and then the summary listed below with their totals. I did not find exactly what I need, just a combination of these steps separately but not sure how to put it together cleanly. I am sorry if this is unclear. Please let me know if you need more info.


[FONT=Helvetica, Arial, Verdana, sans-serif]The formatting part involves other information that needs to summarize the data. It should look like this at the end. Column I7 holds the sum of H1:H6, I8 holds the sum of all values for "14", I9 holds the sum of all values for "21", and H10 holds the sum of the values for "14" & "21" in column I. The values in column "D" in each respective sum row will also need to be part of the coding.[/FONT]


[TABLE="class: text_table"]
<tbody style="margin: 0px; padding: 0px; border: 0px; font-family: inherit; vertical-align: baseline;">[TR]
[TD]A[/TD]
[TD]B[/TD]
[TD]C[/TD]
[TD]D[/TD]
[TD]E[/TD]
[TD]F[/TD]
[TD]G[/TD]
[TD]H[/TD]
[TD]I[/TD]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[TD]11[/TD]
[TD]8701[/TD]
[TD]9004[/TD]
[TD]1030[/TD]
[TD]1001[/TD]
[TD]12.30[/TD]
[TD][/TD]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[TD]11[/TD]
[TD]8701[/TD]
[TD]6650[/TD]
[TD]1020[/TD]
[TD]1003[/TD]
[TD]55.00[/TD]
[TD][/TD]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[TD]14[/TD]
[TD]8701[/TD]
[TD]2200[/TD]
[TD]5656[/TD]
[TD]3500[/TD]
[TD]45.31[/TD]
[TD][/TD]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[TD]14[/TD]
[TD]8701[/TD]
[TD]3350[/TD]
[TD]6006[/TD]
[TD]3000[/TD]
[TD]40.50[/TD]
[TD][/TD]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[TD]21[/TD]
[TD]8701[/TD]
[TD]4450[/TD]
[TD]6412[/TD]
[TD]1003[/TD]
[TD]60.55[/TD]
[TD][/TD]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[TD]21[/TD]
[TD]8701[/TD]
[TD]4000[/TD]
[TD]6501[/TD]
[TD]1003[/TD]
[TD]65.00[/TD]
[TD][/TD]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[TD]11[/TD]
[TD]2020[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD]278.66[/TD]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[TD]14[/TD]
[TD]2802[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD]85.81[/TD]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[TD]21[/TD]
[TD]2802[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD]125.55[/TD]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[TD]11[/TD]
[TD]2801[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD]211.36[/TD]
[TD][/TD]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
</tbody>[/TABLE]
****** id="cke_pastebin" style="position: absolute; top: 0px; width: 1px; height: 1px; overflow: hidden; left: -1000px;">[TABLE="class: text_table"]
<tbody style="margin: 0px; padding: 0px; border: 0px; font-family: inherit; vertical-align: baseline;">[TR]
[TD]A[/TD]
[TD]B[/TD]
[TD]C[/TD]
[TD]D[/TD]
[TD]E[/TD]
[TD]F[/TD]
[TD]G[/TD]
[TD]H[/TD]
[TD]I[/TD]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[TD]11[/TD]
[TD]8701[/TD]
[TD]9004[/TD]
[TD]1030[/TD]
[TD]1001[/TD]
[TD]12.30[/TD]
[TD][/TD]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[TD]11[/TD]
[TD]8701[/TD]
[TD]6650[/TD]
[TD]1020[/TD]
[TD]1003[/TD]
[TD]55.00[/TD]
[TD][/TD]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[TD]14[/TD]
[TD]8701[/TD]
[TD]2200[/TD]
[TD]5656[/TD]
[TD]3500[/TD]
[TD]45.31[/TD]
[TD][/TD]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[TD]14[/TD]
[TD]8701[/TD]
[TD]3350[/TD]
[TD]6006[/TD]
[TD]3000[/TD]
[TD]40.50[/TD]
[TD][/TD]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[TD]21[/TD]
[TD]8701[/TD]
[TD]4450[/TD]
[TD]6412[/TD]
[TD]1003[/TD]
[TD]60.55[/TD]
[TD][/TD]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[TD]21[/TD]
[TD]8701[/TD]
[TD]4000[/TD]
[TD]6501[/TD]
[TD]1003[/TD]
[TD]65.00[/TD]
[TD][/TD]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[TD]11[/TD]
[TD]2020[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD]278.66[/TD]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[TD]14[/TD]
[TD]2802[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD]85.81[/TD]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[TD]21[/TD]
[TD]2802[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD]125.55[/TD]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[TD]11[/TD]
[TD]2801[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD]211.36[/TD]
[TD][/TD]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
</tbody>[/TABLE]
</body>
 

Excel Facts

How to total the visible cells?
From the first blank cell below a filtered data set, press Alt+=. Instead of SUM, you will get SUBTOTAL(9,)

Forum statistics

Threads
1,223,911
Messages
6,175,334
Members
452,636
Latest member
laura12345

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