Sub ClearStrikethroughCells()
Application.FindFormat.Clear
Application.FindFormat.Font.Strikethrough = True
Range("[COLOR=#FF0000][B]A1:Z99[/B][/COLOR]").Replace "*", "", SearchFormat:=True
Application.FindFormat.Clear
End Sub
This should do it (change the highlighted range to the actual range you want to process)...
Code:Sub ClearStrikethroughCells() Application.FindFormat.Clear Application.FindFormat.Font.Strikethrough = True Range("[COLOR=#FF0000][B]A1:Z99[/B][/COLOR]").Replace "*", "", SearchFormat:=True Application.FindFormat.Clear End Sub
What version of Excel are you using? I ask because I have XL2003, XL2007 and XL2010 and my code does not raise that error when there are no strikethroughs for any of these versions. I do not have XL2013 so I cannot test it there. Anyway, because I cannot repeat the error you are seeing, I can only guess at a way to stop it. I would think one of the two following macros should keep the error from appearing... use whichever one works for you.Rick,
I get a "We couldn't find anything to replace" error in a pop up window when there are no available cells with strikethrough formatting. Is there a way to not have an error presented when there are no strikethough formattings?
Sub ClearStrikethroughCells()
Application.FindFormat.Clear
Application.FindFormat.Font.Strikethrough = True
[B][COLOR=#FF0000]On Error GoTo NoStrikethroughs[/COLOR][/B]
Range("A1:Z99").Replace "*", "", SearchFormat:=True
[COLOR=#FF0000][B]NoStrikethroughs:[/B][/COLOR]
Application.FindFormat.Clear
End Sub
Sub ClearStrikethroughCells()
Application.FindFormat.Clear
Application.FindFormat.Font.Strikethrough = True
[COLOR=#FF0000][B]Application.DisplayAlerts = False[/B][/COLOR]
Range("A1:Z99").Replace "*", "", SearchFormat:=True
[COLOR=#FF0000][B]Application.DisplayAlerts = True[/B][/COLOR]
Application.FindFormat.Clear
End Sub