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
The string could be anything the only thing that define him is formatting
Super User is a question and answer site for computer enthusiasts and power users. It only takes a minute to sign up.
Sign up to join this communityHow do I easily delete strings in excel cells with certain formatting.I want to get cell with formatted string deleted like the second cell
The string could be anything the only thing that define him is formatting
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