View Single Post
  #4   Report Post  
Posted to microsoft.public.excel.programming
Dave Peterson Dave Peterson is offline
external usenet poster
 
Posts: 35,218
Default Subtotal row formatting

After you apply data|subtotals, you can hide all the details.

Then you can select the first column (avoid the headers).
Edit|goto|special|visible cells only
and then adjust the row height
format|row|height|20

If you record a macro, you'll see some useable code.

I modified my recorded macro to get this:

Option Explicit
Sub testme02()

Dim myRng As Range
Dim myVRng As Range

'do your subtotals here

With Worksheets("sheet1")
Set myRng = .Range("a2", .Cells(.Rows.Count, "A").End(xlUp))
'hide the details
.Outline.ShowLevels rowlevels:=2

Set myVRng = Nothing
On Error Resume Next
Set myVRng = myRng.Cells.SpecialCells(xlCellTypeVisible)
On Error GoTo 0

If myVRng Is Nothing Then
'something went wrong
Else
With myVRng.EntireRow
.RowHeight = 20
'change the color, too???
.Font.ColorIndex = 3
End With
End If
End With

End Sub

Dan wrote:

I have a macro that includes subtotaling. Is there a way to specify
formatting of the subtotal rows that are automatically inserted, without
having to do it manually after the macro finishes? For example, I'd like to
specify the row height for all of the subtotal rows.

Dan


--

Dave Peterson