Strikethrough cells B2 to E2 (a "row", in essence) when A2 has a checkmark?

  • Thread starter StargateFanFromWork
  • Start date
S

StargateFanFromWork

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 :eek:D
 
B

Bill Pfister

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top