To demonstrate our methods for removing strikethroughs from text in Excel, we’ll use the following dataset:
Method 1 – Using Keyboard Shortcut to Remove Strikethrough from Cells
Steps:
- Select the cells with strikethrough.
- Then press Ctrl+5 on your keyboard.
Strikethroughs are removed from all the cells that previously contained them.
Method 2 – Using Format Cells Feature to Remove Strikethrough from Cells
Steps:
- Select the cells with strikethrough.
- In the Home tab, select the Format Cells option.
- From the Format Cells pop-up window, go to the Font tab and uncheck the checkbox next to Strikethrough in the Effects section.
- Press OK.
Strikethroughs are removed from all the cells that previously contained them.
Method 3 Using VBA to Remove Strikethrough Rows
To delete all the rows containing strikethrough cells (as opposed to removing the strikethrough from cells as in the methods above), using a VBA macro is the safest and most efficient method.
Steps:
- Press Alt + F11 on your keyboard or go to the Developer tab → Visual Basic to open the Visual Basic Editor.
- In the pop-up code window, from the menu bar click Insert → Module.
- Copy the following code and paste it in the code window:
Sub DeleteStrRows()
Dim r As Range
Dim iCheck As Boolean
Dim i As Integer
Dim iRows As Integer
iRows = Selection.Rows.Count
If iRows > 2 Then
For i = iRows To 1 Step -1
iCheck = False
For Each r In Selection.Rows(i).Cells
iCheck = IsNull(r.Font.Strikethrough)
If Not iCheck Then iCheck = r.Font.Strikethrough
If iCheck Then Exit For
Next r
If iCheck Then Selection.Rows(i).EntireRow.Delete
Next i
End If
End Sub
Your code is now ready to run.
- Go back to the worksheet where your strikethrough rows are.
- Select the rows and Run the macro.
This will delete all the strikethrough rows from your Excel worksheet.
Download Practice Template
Related Articles
- How to Remove Numbers from a Cell in Excel
- How to Remove Formulas in Excel
- How to Remove Password from Excel File
- Data clean-up techniques in Excel: Replacing or removing text in cells
is it possible to remove all text within a workbook that is formatted with strikethrough? For example if one cell contains some text that is formatted with strikethrough and some text that is not in the same cell. i would like to remove only the text within the cell that has strikethrough used. not the entire cell.
Hi JOJO,
Thanks for your comment. I am replying to you on behalf of Exceldemy. You can use VBA to remove texts that have strikethrough in them. Suppose, you have some text strings like the picture below:
Let’s follow the steps below to remove the texts with a strikethrough.
STEPS:
1. Firstly, go to the Developer tab and click on the Visual Basic option.
2. Secondly, select Insert >> Module to open the Module window.
3. Now, copy the code below and paste it into the Module window:
Sub Remove_Strike_through_Texts()
Dim iRng As Range, iCell As Range
Dim iStr As String
Dim X As Long
On Error Resume Next
Set iRng = Application.InputBox("Please select range:", "Microsoft Excel", _
Selection.Address, , , , , 8)
If iRng Is Nothing Then Exit Sub
Application.ScreenUpdating = Fase
For Each iCell In iRng
If IsNumeric(iCell.Value) And iCell.Font.Strikethrough Then
iCell.Value = ""
ElseIf Not IsNumeric(iCell.Value) Then
For X = 1 To Len(iCell)
With iCell.Characters(X, 1)
If Not .Font.Strikethrough Then
iStr = iStr & .Text
End If
End With
Next
iCell.Value = iStr
iStr = ""
End If
Next
Application.ScreenUpdating = True
End Sub
4. Press Ctrl + S to save the code.
5. After that, go to the Developer tab and select Macros.
6. In the Macro window, select the desired code and Run it.
7. A message box will appear.
8. Select the range from where you want to remove the strikethrough texts.
9. Finally, click OK to proceed.
10. As a result, the texts with strikethrough will be removed.
I hope this will help you to solve your problem. Please let us know if you have other queries.
Thanks!