Strikethrough cells B2 to E2 (a "row", in essence) when A2 has a checkmark?
The reason this is tricky is because all the other columns have all 3
possible conditional formatting slots taken, so it seems one would need to use code for this. I use the square root symbol (representing a checkmark) in a pulldown menu in column A. So column A is either empty or it has this symbol. When empty, nothing happens; but if user chooses this "checkmark" symbol, the cells in column B to E of that row should then have a strikethrough applied to the text in that row. Also, where would one put the vb code to do this? I've searched the archives but so far no mention has been made on where this type of code to augment conditional formatting should go. tia :oD |
Strikethrough cells B2 to E2 (a "row", in essence) when A2 has a c
Place this code in the "sheet" module that corresponds to the sheet you want to monitor. Regards, Bill Private Sub Worksheet_Change(ByVal Target As Range) Dim strAddress As String Dim rngFormat As Range If (Target.Cells(1).Column = 1) Then strAddress = "B" & Trim$(Target.Cells(1).Row) & ":E" & Trim$(Target.Cells(1).Row) Set rngFormat = Target.Parent.Range(strAddress) If (Len(Target.Cells(1).Value) = 0) Then rngFormat.Font.Strikethrough = False ElseIf (Asc(Target.Cells(1) = 118)) Then ' 118 is the ascii code for the sq rt symbol rngFormat.Font.Strikethrough = True End If Application.Calculate End If End Sub "StargateFanFromWork" wrote: The reason this is tricky is because all the other columns have all 3 possible conditional formatting slots taken, so it seems one would need to use code for this. I use the square root symbol (representing a checkmark) in a pulldown menu in column A. So column A is either empty or it has this symbol. When empty, nothing happens; but if user chooses this "checkmark" symbol, the cells in column B to E of that row should then have a strikethrough applied to the text in that row. Also, where would one put the vb code to do this? I've searched the archives but so far no mention has been made on where this type of code to augment conditional formatting should go. tia :oD |
All times are GMT +1. The time now is 02:59 AM. |
Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com