Formatting subtotal row

exceluseratcci

New Member
Joined
Nov 25, 2002
Messages
33
When I subtotal, the results in the column specified as "at each change in" are bolded, but nothing else on the subtotal row is bolded. Is there a way to make each subtotal row bold? I need to clarify: I would like for the bolding to be done at the same time the spreadsheet is subtotaling, since there are 200+ subtotal lines and I don't want to have to go through the spreadsheet line by line and add the bolding manually.
 
Last edited:

Excel Facts

Copy PDF to Excel
Select data in PDF. Paste to Microsoft Word. Copy from Word and paste to Excel.
Try this :-
Code:
'=============================================================================
'- CHECK EACH CELL IN USED RANGE FOR "SUBTOTAL" IN FORMULA AND MAKE BOLD FONT
'=============================================================================
Sub SUBTOTALS_BOLD()
    Application.Calculation = xlCalculationManual
    For Each c In ActiveSheet.UsedRange
        If InStr(1, c.Formula, "SUBTOTAL", vbTextCompare) > 0 Then
            c.Font.Bold = True
        End If
    Next
    MsgBox ("Done")
End Sub
'=============================================================================
 
Upvote 0
This would do it without looping or conditional If's:

Code:
Sub SubtotalFormats()
Application.ScreenUpdating = False
ActiveSheet.AutoFilterMode = False
Dim LastRow&, FilterRange As Range
LastRow = Cells.Find(What:="*", After:=Range("A1"), SearchOrder:=xlByRows, SearchDirection:=xlPrevious).Row
Set FilterRange = Range("A1:A" & LastRow)
FilterRange.AutoFilter Field:=1, Criteria1:="=*Total"
With FilterRange.Offset(1)
.Resize(.Rows.Count - 1, Range("A1").CurrentRegion.Columns.Count).SpecialCells(12).Font.Bold = True
End With
Set FilterRange = Nothing
ActiveSheet.AutoFilterMode = False
Application.ScreenUpdating = True
End Sub
 
Upvote 0

Forum statistics

Threads
1,215,770
Messages
6,126,791
Members
449,336
Latest member
p17tootie

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top