ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   How can I detect strikethrough formatting in a cell? (https://www.excelbanter.com/excel-discussion-misc-queries/209290-how-can-i-detect-strikethrough-formatting-cell.html)

ww wondering

How can I detect strikethrough formatting in a cell?
 
I'm using conditional formatting in one cell to detect if there is text in
another cell used for notes. When the note is no longer valid, I change the
text formatting to strikethrough so that I still have it for future
reference. I would like to cancel the conditional formatting in the other
cell based on the fact that striketrhough formatting is present. How can I
detect strikethrough formatting in a cell?

Gary''s Student

How can I detect strikethrough formatting in a cell?
 
Assuming that cell A1 has the conditional formatting and cell B1 may have
strikethru font, try this tiny macro:

Sub wondering()
Dim A1 As Range, B1 As Range
Set A1 = Range("A1")
Set B1 = Range("B1")
If B1.Font.Strikethrough Then
A1.FormatConditions.Delete
End If
End Sub

adapt the ranges to your needs
--
Gary''s Student - gsnu200812


"ww wondering" wrote:

I'm using conditional formatting in one cell to detect if there is text in
another cell used for notes. When the note is no longer valid, I change the
text formatting to strikethrough so that I still have it for future
reference. I would like to cancel the conditional formatting in the other
cell based on the fact that striketrhough formatting is present. How can I
detect strikethrough formatting in a cell?


Dave Peterson

How can I detect strikethrough formatting in a cell?
 
I'm not quite sure what you're doing, but I think I'd add an indicator column.

I could use conditional formatting for both of these cells. (CF allows me to
use a strikethrough font.)

But I'm not sure how your existing conditional formatting works, so I don't have
any specific suggestion.





ww wondering wrote:

I'm using conditional formatting in one cell to detect if there is text in
another cell used for notes. When the note is no longer valid, I change the
text formatting to strikethrough so that I still have it for future
reference. I would like to cancel the conditional formatting in the other
cell based on the fact that striketrhough formatting is present. How can I
detect strikethrough formatting in a cell?


--

Dave Peterson

ww wondering[_2_]

How can I detect strikethrough formatting in a cell?
 
Thanks, it worked great!

"Gary''s Student" wrote:

Assuming that cell A1 has the conditional formatting and cell B1 may have
strikethru font, try this tiny macro:

Sub wondering()
Dim A1 As Range, B1 As Range
Set A1 = Range("A1")
Set B1 = Range("B1")
If B1.Font.Strikethrough Then
A1.FormatConditions.Delete
End If
End Sub

adapt the ranges to your needs
--
Gary''s Student - gsnu200812


"ww wondering" wrote:

I'm using conditional formatting in one cell to detect if there is text in
another cell used for notes. When the note is no longer valid, I change the
text formatting to strikethrough so that I still have it for future
reference. I would like to cancel the conditional formatting in the other
cell based on the fact that striketrhough formatting is present. How can I
detect strikethrough formatting in a cell?



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

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