Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
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 |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
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 |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Remove checkmark on "Update links to other documents" | Links and Linking in Excel | |||
Excel - Golf - how to display "-2" as "2 Under" or "4"as "+4" or "4 Over" in a calculation cell | Excel Discussion (Misc queries) | |||
How do I get "&S" to just be "&S" text instead of strikethrough? | Excel Discussion (Misc queries) | |||
"IF" statement & "strikethrough" formatting | Excel Worksheet Functions | |||
Enter a "checkmark" in an AutoFiltered cell | Excel Programming |