Link to home
Start Free TrialLog in
Avatar of ssblue
ssblueFlag for United States of America

asked on

Excel Strike Through

Excel - Strike through not working again????

Cannot understand why this is not working.
StrikeThrough.xlsm
ASKER CERTIFIED SOLUTION
Avatar of Ryan Chong
Ryan Chong
Flag of Singapore image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Sometimes people only format parts of text. For these cases, you may use following code.
Public Function HasStrike(pr As Range) As Boolean
    Dim rv As Boolean
    Dim istr As Integer
    On Error Resume Next
    rv = pr.Font.Strikethrough
    For istr = 1 To Len(pr.Text)
        rv = rv Or pr.Characters(istr, 1).Font.Strikethrough
    Next istr
    HasStrike = rv
End Function

Open in new window

Avatar of ssblue

ASKER

Thanks!  How do I tell that it wasn't in a module??
How do I tell that it wasn't in a module??

well, you can double click the Macro codes from your Project Explorer, and do a search (in Current Module)...

User generated image
Avatar of ssblue

ASKER

Thanks!!