PDA

View Full Version : Formating Subtotals



starsky
11-25-2009, 08:31 AM
Hi,

I recorded the code below with aim of formating occupied subtotal cells. However, the format is applied to all the empty cells below the final grand total row. How can I restrict the format to the range I want?

Thanks.

Selection.Subtotal GroupBy:=2, Function:=xlSum, TotalList:=Array(9, 13), _
Replace:=True, PageBreaks:=False, SummaryBelowData:=True
ActiveSheet.Outline.ShowLevels RowLevels:=2
Range("I:I,M:M").SpecialCells(xlCellTypeVisible, xlNumbers).Interior.ColorIndex = 15
Range("I:I,M:M").SpecialCells(xlCellTypeVisible, xlNumbers).Font.Bold = True

lucas
11-25-2009, 11:15 AM
You use selection so what area did you select before running this?

starsky
11-26-2009, 03:23 AM
That was part of the recorded subtotal process. You have to select at least one cell, and it then selects the entire range automatically.

lucas
11-26-2009, 08:51 AM
starsky, could you possibly post your workbook.

click on go advanced and scroll down and look for a button that says manage attachments.