ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   How to format with a strikethrough like something's been crossed out (https://www.excelbanter.com/excel-programming/384324-how-format-strikethrough-like-somethings-been-crossed-out.html)

[email protected][_2_]

How to format with a strikethrough like something's been crossed out
 
I'd like to write text in a cell and have a line go through the middle
showing that it's been "crossed out".

How do I do that?

Thanks.


Dave Peterson

How to format with a strikethrough like something's been crossed out
 
Select the cells to fix
Format|Cells|Font Tab
check strikethrough



" wrote:

I'd like to write text in a cell and have a line go through the middle
showing that it's been "crossed out".

How do I do that?

Thanks.


--

Dave Peterson

merjet

How to format with a strikethrough like something's been crossed out
 
Range("A1").FormulaR1C1 = "text"
Range("A1").Font.Strikethrough = True

Hth,
merjet


Vergel Adriano

How to format with a strikethrough like something's been crossed o
 
To do that in A1,

Range("A1").Value = "Cross this out"
Range("A1").Font.Strikethrough = True


" wrote:

I'd like to write text in a cell and have a line go through the middle
showing that it's been "crossed out".

How do I do that?

Thanks.



Gord Dibben

How to format with a strikethrough like something's been crossed o
 
Private Sub Worksheet_Change(ByVal Target As Range)
'Strikethrough ignore spaces
Dim v As Variant, i As Integer
If Not Intersect(Target, Columns("A")) Is Nothing Then
If Target(1, 1).HasFormula = False Then
v = Target(1, 1).Value
Application.EnableEvents = False
For i = 1 To Len(v)
If Not (Mid(v, i, 1)) = Chr(32) Then
Target(1, 1).Characters(Start:=i, _
Length:=1).Font.Strikethrough = True
End If
Next i
Application.EnableEvents = True
End If
End If
End Sub


Gord Dibben MS Excel MVP

On Thu, 1 Mar 2007 18:02:05 -0800, Vergel Adriano
wrote:

To do that in A1,

Range("A1").Value = "Cross this out"
Range("A1").Font.Strikethrough = True


" wrote:

I'd like to write text in a cell and have a line go through the middle
showing that it's been "crossed out".

How do I do that?

Thanks.





All times are GMT +1. The time now is 01:18 PM.

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