strikethroughs

S

strikethrughs

How do you apply strikethroughs to a row where some cells contains characters
and other cells contains spaces?
 
K

kassie

Not clear what you are after? Spaces will appear like a minus sign, while
text and numbers will appear like strikethrough.
 
G

Gord Dibben

I assume you don't want the spaces having a strikethrough.

A macro or event code can find the spaces and ignore them.

Macro..............

Sub strike_through()
'Strikethrough ignore spaces
Dim v As Variant, i As Integer
Dim cel As Range
For Each cel In Selection
If cel.HasFormula = False Then
v = cel.Value
For i = 1 To Len(v)
If Not (Mid(v, i, 1)) = Chr(32) Then
cel.Characters(Start:=i, _
Length:=1).Font.Strikethrough = True
End If
Next i
End If
Next cel
End Sub


Gord Dibben MS Excel MVP
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top