2

How do I easily delete strings in excel cells with certain formatting.I want to get cell with formatted string deleted like the second cell

enter image description here

The string could be anything the only thing that define him is formatting

2

I can't see a way of doing it without code if the formatting is mixed within a cell. You could use a UDF like this below :

Function DeleteFormat(aSource As Range) As String       
    Underline = xlUnderlineStyleSingle
    Strikethrough = True
    DeleteFormat = ""
    For i = 1 To Len(aSource.Value)
        If Not (aSource.Characters(i, 1).Font.Strikethrough = Strikethrough And     aSource.Characters(i, 1).Font.Underline = Underline) Then
            DeleteFormat = DeleteFormat & aSource.Characters(i, 1).Text
        End If
    Next

End Function

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.