PDA

View Full Version : [SOLVED] Faster way delete strikethrough



KongUK
10-20-2017, 02:32 AM
Hi

I am currently using this method which I found on the net to delete any cell in a specific column that has strikethrough


Dim rng As Range, cl As Range
Dim i As Long
Set rng = Range("E:E")
For Each cl In rng.Cells
For i = Len(cl.Value) To 1 Step -1
If cl.Characters(i, 1).Font.Strikethrough Then
cl.Characters(i, 1).Delete
End If
Next i, cl


It works fine but it looks like it checks every character in the string (I only need to delete whole cell content as this will always be the case), therefore is a little slow, couple of seconds per run.

I also am using same method to find various other formats like RGB font colour. So when these all run sequentially the processing time adds up

Is there a better way to apply this either with no loop or faster loop?

Thank you

mana
10-20-2017, 03:01 AM
For Each cl In rng.SpecialCells(2)

KongUK
10-20-2017, 03:56 AM
Wow, a lot quicker thank you very much :)