EXCEL delete strikethru text doesn't work if the cell is too large (~255 char?)

This code works fine to eliminate strikethru text on smaller cells but not larger ones:

Sub StrikeThru()
    Dim ws      As Worksheet
    Dim Cell    As Range
    
    For Each ws In ActiveWorkbook.Worksheets
  
    
    ws.Activate
    ws.UsedRange.Select
         
    For Each Cell In Selection
       DelStrikethroughs Cell
    Next Cell
            
    Next ws
End Sub


Sub DelStrikethroughs(Cell As Range)
   'deletes all strikethrough text in the Cell
   Dim NewText    As String
   Dim iCh        As Integer
   Dim Savetext    As String
   
   On Error GoTo skipCell
   For iCh = Len(Cell) To 1 Step -1
       
   If Cell.Characters(iCh, 1).Font.Strikethrough = True Then
            Savetext = Cell.Characters(iCh, 1).Text
            Cell.Characters(iCh, 1).Delete
            
         End If
     
   Next iCh
  
   GoTo EndSub
   
skipCell:
'Debug.Print "Whoa " & Cell.Row & "-" & Cell.Column

EndSub:

End Sub

August 20th, 2015 7:15pm

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics