ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Setting up and Configuration of Excel (https://www.excelbanter.com/setting-up-configuration-excel/)
-   -   strikethroughs (https://www.excelbanter.com/setting-up-configuration-excel/118961-strikethroughs.html)

strikethrughs

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

kassie

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

"strikethrughs" wrote:

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


Gord Dibben

strikethroughs
 
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

On Wed, 15 Nov 2006 10:45:02 -0800, strikethrughs
wrote:

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




All times are GMT +1. The time now is 10:45 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com