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 remove or delete all strikethrough texts or characters from cells in Excel?

This article is talking about removing all strikethrough texts or characters from multiple cells in Excel.

Remove all strikethrough texts from cells with VBA code

Enable you to do smarter, faster and better

Kutools - the best office productivity tool brings 300 advanced features to Excel. Details... Download...

Office Tab - brings tabbed interface to Excel and Word, make your work much easier. Details...Download...


Remove all strikethrough texts from cells with VBA code


The below VBA code can help you remove all texts in cells which have been marked with strikethrough. Please do as follows.

1. In the worksheet contains the strikethrough texts you need to remove, press the Alt + F11 keys simultaneously to open the Microsoft Visual Basic for Applications window.

2. In the Microsoft Visual Basic for Applications window, please click Inset > Module. Then copy and paste below VBA code into the Code window.

VBA code: Remove all strikethrough texts from cells

Sub DelStrikethroughText()
    Dim xRg As Range, xCell As Range
    Dim xStr As String
    Dim I As Long
    On Error Resume Next
    Set xRg = Application.InputBox("Please select range:", "KuTools For Excel", Selection.Address, , , , , 8)
    If xRg Is Nothing Then Exit Sub
    Application.ScreenUpdating = Fase
        For Each xCell In xRg
            If IsNumeric(xCell.Value) And xCell.Font.Strikethrough Then
                xCell.Value = ""
            ElseIf Not IsNumeric(xCell.Value) Then
                For I = 1 To Len(xCell)
                    With xCell.Characters(I, 1)
                        If Not .Font.Strikethrough Then
                            xStr = xStr & .Text
                        End If
                    End With
                Next
                xCell.Value = xStr
                xStr = ""
            End If
        Next
    Application.ScreenUpdating = True
End Sub

3. Press the F5 key or click the Run button to run the code. In the popping up Kutools for Excel dialog box, please select the range contains the strikethrough texts you will remove, and then click the OK button. See screenshot:

Then all texts marked with a strikethrough are removed from cells immediately as below screenshot shown.


Related articles:



Excel Productivity Tools

Kutools for Excel - The Best Office Productivity Tool

  • Brings 300 powerful advanced features to Excel, enable you to do smarter, faster and better.
  • 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.

Office Tab - brings tabbed interface to Office, 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!
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.
  • To post as a guest, your comment is unpublished.
    san · 19 days ago
    I use it for the whole column and my excel never come back....
  • To post as a guest, your comment is unpublished.
    Girish · 4 months ago
    can it be done through python, pandas ?
    If yes can anybody help me out how to implement this ?
    • To post as a guest, your comment is unpublished.
      crystal · 4 months ago
      Hi Girish,
      The code hasn't been tested in python, pandas. Sorry can't help you with that. Thanks for commenting.
  • To post as a guest, your comment is unpublished.
    Upul · 1 years ago
    This does not work. Excel goes into Not Responding.
    • To post as a guest, your comment is unpublished.
      Josh · 4 months ago
      It works in small scale. I assume that the reason it goes into Not Responding is because the Macro takes forever when you have a lot of data to get through. This Macro is checking every single character for strike through.

      I would recommend adding code that reformats the cell when it is done because I had several cells where the code removed the strikethrough text but the remaining text was still in strikethrough. I believe this is because the formatting of the full cell was strikethrough with the non strikethrough text being formatted differently, so just an FYI.
    • To post as a guest, your comment is unpublished.
      crystal · 1 years ago
      Good day,
      Sorry for the inconvenience. Would you provide your Office version? Thanks for your comment.
      • To post as a guest, your comment is unpublished.
        Boris · 8 months ago
        Same here.

        I am using Office 365 ProPlus