Code for Sub-Total command with rows changing in Macro

danuguri

New Member
Joined
Dec 18, 2013
Messages
1
Dear Sir,

I am trying to have a code (to be written for macro) for performing Sub-Totals in the column I excel sheet as a part of automation. The rows will be dynamic and No. of rows for each sub-total changes every time. The sub-total shall be based on certain criteria which will be in other columns. Manually we are filtering for blanks on B column and E column and inserting sub-total formula in I column for sum operation. The total no. of rows may be upto 5000 Lines or more and may be even as less as 100 rows. No. of sub-totals may also vary depending on the rows. Once the macro is run, it shall all perform all the sub-totals based on above explained criteria.

Can any one help.

Pls. see below small example.

Slno.SubItem Description UOMGross Qty Changes in PricesFinal Amount
BU111811947502HV00000Main Item:BU111811947502HV00000 INSULATION ON HV COIL
BU111811947502HV00000 107140400100P.B. GRADE-KPC:1x2000x3000mm kg 10.6337185.001851967.23
BU111811947502HV00000 107140000150P.B. 1.50 mm GRADE-KPC (IB-56 kg 24.2116.70116.72824.14
BU111811947502HV00000 107140400200P.B. GRADE-KPC:2x2000x3000mm kg 6.6185.001851221.00
BU111811947502HV00000 107140000300P.B. 3.00 mm GRADE-KPC (IB-56 kg 9.9116.70116.71155.33
BU111811947502HV00000 107140000400P.B. 4.00 mm GRADE-KPC (IB-56 kg 2.9334122.84122.84360.34
BU111811947502HV00000 107140000500P.B. 5.00 mm GRADE-KPC (IB-56 kg 2.5663122.84122.84315.24
BU111811947502HV00000 107140000600P.B. 6.00 mm GRADE-KPC(IB-56) kg 5.5122.84122.84675.62
BU111811947502HV00000 107100000080P.B 0.80 mm GRADE-3 kg 0.7337220.42220.42161.72
BU111811947502HV00000 BU1118119207140400150P.B.GRADE-KPC:1.5X2000X3000mm kg 1.65116.70116.7192.56
BU111811947502HV00000 107140400300P.B. GRADE-KPC:3x2000x3000mm kg 22185.001854070.00
BU111811947502HV00000 BU1118119207020100001HV IND RING : 709/581 , 35thknos12323.832323.83292323.83
BU111811947502HV00000 BU1118119207020100002HV IND.RING 2:709/581;35THK Nos12323.832323.83292323.83
BU111811947502HV00000 17590.85
BU111811947504CA00000Main Item:BU111811947504CA00000 INSULATION AT CORE ASSEMBLY
BU111811947504CA00000 107140000400P.B. 4.00 mm GRADE-KPC (IB-56 kg 15.18122.84122.841864.71
BU111811947504CA00000


Thanks in advance.

Regards

D Sampath Kumar
1864.71

<TBODY>
</TBODY><COLGROUP><COL><COL><COL><COL><COL span=2><COL><COL><COL></COLGROUP>
 

Excel Facts

Lock one reference in a formula
Need 1 part of a formula to always point to the same range? use $ signs: $V$2:$Z$99 will always point to V2:Z99, even after copying

Forum statistics

Threads
1,214,590
Messages
6,120,423
Members
448,961
Latest member
nzskater

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