Macro to delete subtotal amount


Posted by A.R. on May 08, 2001 9:30 AM

I have Excel files that show the subtotal amount every 5-10 rows. I need to delete these rows which display only the subtotals. The method I’m using is deleting the row with the subtotal, but these Excel files have over 50 rows and it is time consuming. Is there a way for a macro to find the subtotals, which are in bold, and then deleting all those rows with the subtotal at once? Note that the only data that is bold is the subtotal amount. If there is, please provide me the macro code. Thank you.



Posted by Sean on May 08, 2001 9:52 AM

If you want to hide the rows with subtotals, you can do this by adding a filter onto one of the columns that do not get included (sumed into) the subtotal function. These new cells on these rows will by blank.

Next set the filter onto "Non Blanks",

Alternatively you can filter the column used for the subtotalling.
next choose Custom.
Then in the 1st box select
does not contain
In the second box enter
Total

If you need to get a Total for the lines remaining use the
=SUBTOTAL(9,a1:a100) function

Hope this help
Sean
s-o-s@lineone.net