Hi,
I am trying to detect which cells contain text that is strikethrough, but my loop is passing over a bunch of cells without detecting the strikethrough text in them.
Here's my Code:
I am trying to detect which cells contain text that is strikethrough, but my loop is passing over a bunch of cells without detecting the strikethrough text in them.
Here's my Code:
VBA Code:
Private Sub FilterList()
Dim ws As Worksheet
Dim rngCheck As Range, rng As Range
Dim lastRow As Long
Dim lastCol As Long
Set ws = ThisWorkbook.Sheets(1)
lastCol = ws.UsedRange.Find("reference").column
lastRow = ws.Cells(Rows.Count, 1).End(xlUp).row
Set rng = ws.Range("A1:" & Chr(64 + lastCol) & CStr(lastRow))
For Each rngCheck In rng.SpecialCells(xlCellTypeVisible)
rngCheck.Select
If rngCheck.Cells.Font.Strikethrough = True Then
rngCheck.Cells.Interior.Color = RGB(255, 0, 0)
Else
End If
Next rngCheck
End Sub
Last edited by a moderator: