How do I automatically format subtotals in excel?

G

Guest

On the Data menu, I use the "Subtotal" tool frequently. However, in order to
make the subtotals "pop out" from the rest of the date when I print out the
worksheet, I have to manually select and bold each subtotal row. Isn't there
a way to somehow format the subtotal rows automatically?
 
D

Dave Peterson

How about just a little work???

Use the outlining symbols to the left to show just the subtotal rows.
Select those rows
Edit|goto|Special|visible cells only
format to your heart's content.
 
K

Ken Wright

Or assuming your subtotal titles are in Col A, then select whole sheet and
do Format / Conditional Formatting, change cell value is to formula is and
use =RIGHT($A1,5)="Total" then select Bold in the dialog box.
 
J

Jef Gorbach

or if you need more extensive formating, the following changes Subtotals to
12pt Arial Bold, left aligned below a continuous medium line.

Sub format_subtotals()
Subtotal_column=6
For rowindex = 1 To ActiveSheet.UsedRange.Rows.Count
If Cells(rowindex, subtotal_column).HasFormula = True Then
'row contains a subtotal so format it
With Range(Cells(rowindex, 1), Cells(rowindex, subtotal_column))
.Borders(xlEdgeTop).LineStyle = xlContinuous
.Borders(xlEdgeTop).Weight = xlMedium
.Borders(xlEdgeTop).ColorIndex = xlAutomatic
.Font.Bold = True
.Font.Name = "Arial"
.Font.Size = 12
.HorizontalAlignment = xlLeft
End With
Else 'do nothing
End If
Next rowindex
Columns(subtotal_column).AutoFit
Columns(subtotal_column).HorizontalAlignment = xlRight
End Sub

Ken Wright said:
Or assuming your subtotal titles are in Col A, then select whole sheet and
do Format / Conditional Formatting, change cell value is to formula is and
use =RIGHT($A1,5)="Total" then select Bold in the dialog box.

--
Regards
Ken....................... Microsoft MVP - Excel
Sys Spec - Win XP Pro / XL 97/00/02/03

-------------------------------------------------------------------------- --
It's easier to beg forgiveness than ask permission :)
-------------------------------------------------------------------------- --

Dave Peterson said:
How about just a little work???

Use the outlining symbols to the left to show just the subtotal rows.
Select those rows
Edit|goto|Special|visible cells only
format to your heart's content.
out
Isn't
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top