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 3:16pm

Hi rothschild,

This is the forum to discuss questions and feedback for Microsoft Office 2010, I'll move your question to the MSDN forum for Excel

http://social.msdn.microsoft.com/Forums/en-US/home?forum=exceldev&filter=alltypes&sort=lastpostdesc

The reason why we recommend posting appropriately is you will get the most qualified pool of respondents, and other partners who read the forums regularly can either share their knowledge or learn from your interaction with us. Thank you for your understanding.

Regards,

Emi Zhang
TechNet Community Su

Free Windows Admin Tool Kit Click here and download it now
August 21st, 2015 1:29am

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

Other recent topics Other recent topics