Tip: Other languages are Google-Translated. You can visit the English version of this link.
Log in
x
or
x
x
Register
x

or

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


Select Specific Cells (select cells/row/columns based on one ore two criteria.)

doc select specific cells

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.

Kutools for Excel, with more than 120 handy Excel functions, enhance your working efficiency and save your working time.

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 120 handy Excel functions, enhance your working efficiency and save your working time.

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.

pay attention1If you are interested in this addi-in, click here to download the 60-days free trial.

Recommended Productivity Tools for Excel

kte tab 201905

Kutools for Excel Helps You Always Finish Work Ahead of Time, and Stand Out From Crowd

  • More than 300 powerful advanced features, designed for 1500 work scenarios, increasing productivity by 70%, give you more time to take care of family and enjoy life.
  • No longer need memorizing formulas and VBA codes, give your brain a rest from now on.
  • Become an Excel expert in 3 minutes, Complicated and repeated operations can be done in seconds, 
  • Reduce thousands of keyboard & mouse operations every day, say goodbye to occupational diseases now.
  • 110,000 highly effective people and 300+ world-renowned companies' choice.
  • 60-day full features free trial. 60-day money back guarantees. 2 years of free upgrade and support.

Brings Tabbed Browsing and Editing to Microsoft Office, Far More Powerful Than The Browser's Tabs

  • Office Tab is designed for Word, Excel, PowerPoint and Other Office Applications: 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!
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.