Skip to main content

How to highlight all subtotal rows at once in Excel?

Author: Xiaoyang Last Modified: 2020-05-27

In Excel, we often add subtotals for a large worksheet to count or analyze the data, and the subtotal rows are formatted with bold font by default. But, sometimes, we need the subtotal rows to be stand out the crowd, so that we can view them quickly and intuitively. In this case, we can highlight all the subtotal rows with a desired formatting.

Highlight all subtotal rows with Go To Special function
Highlight all subtotal rows with Conditional Formatting
Highlight all subtotal rows with VBA code
Easily select and highlight all subtotal rows with Kutools for Excel


Highlight all subtotal rows with Go To Special function

As we all known, when we add subtotals for the data, the outline symbols will be displayed at the left of the worksheet as following screenshot shown:

doc-highlight-subtotals1

Now, we can fold the outline and just leave the Total and Grand Total rows. And then apply formatting for these visible rows only. Please do with following steps:

1. Click outline level 2 to display the subtotals and Grand total rows only. See screenshot:

doc-highlight-subtotals1

2. And then select these displayed subtotal rows, and click Home > Find & Select > Go To Special.

doc-highlight-subtotals1

3. In the Go To Special dialog box, check Visible cells only option, see screenshot:

doc-highlight-subtotals1

4. Then click OK button to close the dialog, and only the subtotal rows have been selected.

doc-highlight-subtotals1

5. And then you can format them with a background color as you like by clicking Home > Fill Color.

doc-highlight-subtotals1

6. At last, click outline level 3 in the left pane to expand the detail information, and the subtotal rows have been highlighted from the crowded data. See screenshot:

doc-highlight-subtotals1


Select the entire row if cell contains specific value in Excel:

The Kutools for Excel's Select Specific Cells utility helps you easily select the entire rows based on specific cell values in Excel as the below screenshot shown.
Download and try it now! (30-day free trail)


Highlight all subtotal rows with Conditional Formatting

Conditional Formatting is a powerful feature in Excel, we can also use it to highlight all subtotal rows immediately.

1. Select your data range or whole worksheet which contains subtotal rows.

2. Click Home > Conditional Formatting > New Rule, see screenshot:

doc-highlight-subtotals1

3. In the New Formatting Rule dialog box, click Use a formula to determine which cell to format, and enter this formula =ISNUMBER(FIND("Total",$A1)) into the Format values where this formula is true text box (A1 indicates the column that your subtotals are located, if the subtotals are in column C, you would use C1 instead of A1 in the formula ). See screenshot:

doc-highlight-subtotals1

4. Then click Format button, in the popped out Format Cells dialog, choose one color you like to format the subtotal rows under Fill tab.

doc-highlight-subtotals1

5. And then click OK > OK to close the dialogs, and the entire rows which contain subtotal values have been highlighted if you selected the whole worksheet.

doc-highlight-subtotals1


Highlight all subtotal rows with VBA code

With the following VBA code, we can easily highlight the entire rows containing the subtotal and grand total values.

1. Hold down the ALT + F11 keys to open the Microsoft Visual Basic for Applications window.

2. Click Insert > Module, and paste the following code in the Module Window.

VBA code: highlight all subtotal rows in Excel

Sub FormatTotalRows()
'Update 20140318
Dim Rng As Range
Dim WorkRng As Range
On Error Resume Next
xTitleId = "KutoolsforExcel"
Set WorkRng = Application.Selection
Set WorkRng = Application.InputBox("Range", xTitleId, WorkRng.Address, Type:=8)
For Each Rng In WorkRng
    If Right(Rng.Value, 5) = "Total" Then
        Rng.EntireRow.Interior.ColorIndex = 6
    End If
    If Right(Rng.Value, 11) = "Grand Total" Then
        Rng.EntireRow.Interior.ColorIndex = 8
    End If
Next
End Sub

3. Then press F5 key to run this code, and a prompt box will pop out to remind you select your data range.

doc-highlight-subtotals1

4. And then click OK, the subtotal rows are colored by yellow and the grand total row is filled with blue.

doc-highlight-subtotals1

Note: You can format the color you like by changing the ColorIndex in the above code.


Highlight all subtotal rows with Kutools for Excel

This section will recommend you the Select Specific Cells utility of Kutools for Excel. With this utility, you can easily select all rows which contain word "total" in specified column, and then specify a fill color to highlight them.

Before applying Kutools for Excel, please download and install it firstly.

1. Select the column contains word "total" you will highlight rows based on. Then click Kutools > Select > Select Specific Cells. See screenshot:

2. In the Select Specific Cells dialog box, please do as follows.

  • (1) select Entire row option in the Selection type section.
  • (2) in the Specific type section, select Contains in the drop-down list, enter Total into the box.
  • (3) Click the OK button

3. Now all subtotal rows are selected immediately. Please specify a background color in the Font group under Home tab in Excel to highlight them.

  If you want to have a free trial (30-day) of this utility, please click to download it, and then go to apply the operation according above steps.


Easily select and highlight all subtotal rows with Kutools for Excel


Related articles:

Best Office Productivity Tools

🤖 Kutools AI Aide: Revolutionize data analysis based on: Intelligent Execution   |  Generate Code  |  Create Custom Formulas  |  Analyze Data and Generate Charts  |  Invoke Kutools Functions
Popular Features: Find, Highlight or Identify Duplicates   |  Delete Blank Rows   |  Combine Columns or Cells without Losing Data   |   Round without Formula ...
Super Lookup: Multiple Criteria VLookup    Multiple Value VLookup  |   VLookup Across Multiple Sheets   |   Fuzzy Lookup ....
Advanced Drop-down List: Quickly Create Drop Down List   |  Dependent Drop Down List   |  Multi-select Drop Down List ....
Column Manager: Add a Specific Number of Columns  |  Move Columns  |  Toggle Visibility Status of Hidden Columns  |  Compare Ranges & Columns ...
Featured Features: Grid Focus   |  Design View   |   Big Formula Bar    Workbook & Sheet Manager   |  Resource Library (Auto Text)   |  Date Picker   |  Combine Worksheets   |  Encrypt/Decrypt Cells    Send Emails by List   |  Super Filter   |   Special Filter (filter bold/italic/strikethrough...) ...
Top 15 Toolsets12 Text Tools (Add Text, Remove Characters, ...)   |   50+ Chart Types (Gantt Chart, ...)   |   40+ Practical Formulas (Calculate age based on birthday, ...)   |   19 Insertion Tools (Insert QR Code, Insert Picture from Path, ...)   |   12 Conversion Tools (Numbers to Words, Currency Conversion, ...)   |   7 Merge & Split Tools (Advanced Combine Rows, Split Cells, ...)   |   ... and more

Supercharge Your Excel Skills with Kutools for Excel, and Experience Efficiency Like Never Before. Kutools for Excel Offers Over 300 Advanced Features to Boost Productivity and Save Time.  Click Here to Get The Feature You Need The Most...

Description


Office Tab Brings Tabbed interface to Office, and Make Your Work Much Easier

  • Enable tabbed editing and reading in Word, Excel, PowerPoint, Publisher, Access, Visio and Project.
  • Open and create multiple documents in new tabs of the same window, rather than in new windows.
  • Increases your productivity by 50%, and reduces hundreds of mouse clicks for you every day!
Comments (2)
No ratings yet. Be the first to rate!
This comment was minimized by the moderator on the site
Your answer isn't making bold the number that is underpinned by the SUBTOTAL formula
This comment was minimized by the moderator on the site
Only the text has been made bold - what about the number underpinned by SUBTOTAL formulae? That's what would make the data totals stand out.
There are no comments posted here yet
Leave your comments
Posting as Guest
×
Rate this post:
0   Characters
Suggested Locations