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
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