ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   how can I test in a formula if my font is strikethrough or not? (https://www.excelbanter.com/excel-discussion-misc-queries/139729-how-can-i-test-formula-if-my-font-strikethrough-not.html)

JFD_TP

how can I test in a formula if my font is strikethrough or not?
 


PCLIVE

how can I test in a formula if my font is strikethrough or not?
 
You could do this with VBA.

To test cell A1:

Sub StrikethoughTest()
If Range("A1").Font.Strikethrough = True _
Then
MsgBox ("Cell A1 is using Strikethrough.")
Else
MsgBox ("Cell A1 is NOT using Strikethrough.")
End If
End Sub


To test the active cell:

Sub StrikethoughTest()
If ActiveCell.Font.Strikethrough = True _
Then
MsgBox ("Cell " & ActiveCell.Address & " is using Strikethrough.")
Else
MsgBox ("Cell " & ActiveCell.Address & " is NOT using
Strikethrough.")
End If

End Sub

HTH,
Paul


"JFD_TP" wrote in message
...





All times are GMT +1. The time now is 05:57 AM.

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