How to find all underlined texts in a range or whole worksheet in Excel?

Supposing you have a range of data in a worksheet, and some of the data is with underline, and now you want to find out these data with underline, how can you quickly find out them? Here I introduce some tricks for you to quickly find out the underlined texts in a range or whole worksheet in Excel.

Find all underlined texts in a worksheet with VBA

Find all underlined texts in a range or worksheet with Kutools for Excel good idea3


arrow blue right bubble Find all underlined texts in a worksheet with VBA

In Excel, you cannot use Go To Special function to find out the underlined texts, so I introduce a VBA code to help you find all underlined texts in a worksheet.

1. Press Alt + F11 keys to open Microsoft Visual Basic for Applications window, and click Insert > Module.

2. In the popping Module window, paste below VBA code.

VBA: Find all underlined text in a worksheet.

Sub SearchForUnderline()
'Updateby20150910
    Dim Rg As Range, Rg1 As Range
    Dim I As Long
    Dim xAddress As String, xAddress1 As String, xAddress2 As String
    Dim Result As String
    On Error Resume Next
    xAddress = Application.ActiveWindow.RangeSelection.Address
    Set Rg = Application.InputBox("Please select a range:", "Kutools for Excel", xAddress, , , , , 8)
    If Rg Is Nothing Then Exit Sub
    Set Rg = Application.Intersect(Rg, Application.ActiveSheet.UsedRange)
    If Rg Is Nothing Then Exit Sub
    Set Rg = Rg.SpecialCells(xlCellTypeConstants)
    If Rg Is Nothing Then Exit Sub
    For Each Rg1 In Rg
        For I = 1 To Len(Rg1)
            If Rg1.Characters(I, 1).Font.Underline = xlUnderlineStyleSingle Then
                If xAddress1 = "" Then
                    xAddress1 = Rg1.Address
                Else
                    xAddress1 = xAddress1 & ", " & Rg1.Address
                End If
                Exit For
            End If
        Next
        For I = 1 To Len(Rg1)
            If Rg1.Characters(I, 1).Font.Underline = xlUnderlineStyleDouble Then
                If xAddress2 = "" Then
                    xAddress2 = Rg1.Address
                Else
                    xAddress2 = xAddress2 & ", " & Rg1.Address
                End If
                Exit For
            End If
        Next
    Next
    If xAddress1 <> "" Then Result = "Single underline address:" & vbCr & xAddress1 & vbCr & vbCr
    If xAddress2 <> "" Then Result = Result & "Double underline address:" & vbCr & xAddress2
    If Result <> "" Then MsgBox Result
End Sub

3. Click Run button or press F5 key. And a dialog pops out for select a range to find underlined texts.

doc find underlined text 1

4. Click OK, then a dialog will pop out to tell you which cells are single underlined texts, and which are double underlined texts.

doc find underlined text 2

If you just want to find out one type of underlined texts in a specific range, this VBA code cannot help you, but you can use below handy tool to solve this task in this case.


arrow blue right bubble Find all underlined texts in a range or worksheet with Kutools for Excel

If you have Kutools for Excel installed, you can apply the Select Cells with Format utility to quickly find out the underlined texts in a range of a whole worksheet.

Kutools for Excel, with more than 300 handy functions, makes your jobs more easier. 

After free installing Kutools for Excel, please do as below:

1. Select a blank cell, and then type a data into it, for instance, A1, and click Home > Underline, and select a type of underline you need. See screenshot:

doc find underlined text 3

2. Then select the range you want to find out the specific underlined texts, and click Kutools > Select > Select Cells with Format. See screenshot:

doc find underlined text 4

3. And in the Select Cells with Format dialog, click Choose Format From Cell to select the cell you format with underline in step1. See screenshot:

doc find underlined text 5
doc find underlined text 6

4. Click OK, and in the Select Cells with Format dialog, check Underline only. See screenshot:

doc find underlined text 7

5. Click Ok, then a dialog pops out to remind you how many underlined texts are selected, click Yes to close it.

doc find underlined text 8

Now all the underlined texts are selected.

doc find underlined text 9

Tips:

1. If you want to find out all underlined texts in a whole worksheet, click the left corner of the worksheet to select entire worksheet, and then apply the Select Cells with Format utility.

2. Check Ignore the blank cells in Select Cells with Format dialog, it will ignore the blank cells even though the blank cells are formatted with underline.


The Best Office Productivity Tools

Kutools for Excel Solves Most of Your Problems, and Increases Your Productivity by 80%

  • Reuse: Quickly insert complex formulas, charts and anything that you have used before; Encrypt Cells with password; Create Mailing List and send emails...
  • Super Formula Bar (easily edit multiple lines of text and formula); Reading Layout (easily read and edit large numbers of cells); Paste to Filtered Range...
  • Merge Cells/Rows/Columns without losing Data; Split Cells Content; Combine Duplicate Rows/Columns... Prevent Duplicate Cells; Compare Ranges...
  • Select Duplicate or Unique Rows; Select Blank Rows (all cells are empty); Super Find and Fuzzy Find in Many Workbooks; Random Select...
  • Exact Copy Multiple Cells without changing formula reference; Auto Create References to Multiple Sheets; Insert Bullets, Check Boxes and more...
  • Extract Text, Add Text, Remove by Position, Remove Space; Create and Print Paging Subtotals; Convert Between Cells Content and Comments...
  • Super Filter (save and apply filter schemes to other sheets); Advanced Sort by month/week/day, frequency and more; Special Filter by bold, italic...
  • Combine Workbooks and WorkSheets; Merge Tables based on key columns; Split Data into Multiple Sheets; Batch Convert xls, xlsx and PDF...
  • More than 300 powerful features. Supports Office/Excel 2007-2019 and 365. Supports all languages. Easy deploying in your enterprise or organization. Full features 30-day free trial. 60-day money back guarantee.
kte tab 201905

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!
officetab bottom
Say something here...
symbols left.
You are guest ( Sign Up? )
or post as a guest, but your post won't be published automatically.
Loading comment... The comment will be refreshed after 00:00.

Be the first to comment.