J.W. Aldridge said:
If user clicks on any cell in column J, i need for that cell to state
"done" and the active row (A:J) to highlight/change background to
gray.
If they click again, remove the highlight and word.
Like 50% of anything I do, this is a bastardization of someone's
bastardization of Chip Pearson's code. I think it originally was meant as a
sheet change, rather than selection change. I'm sure there's a better way
to specify the J column (alert; I only went down to 65000), and there's also
no error handling for an accidental multiple selection; also, to make the
event work twice you have to click outside the cell and click back on it;
clicking on it once and then again without leaving it won't trigger the 2nd
event. Also keep in mind that this assumes you either want "Done" or
nothing; there's no allowing for other values when clicking in J.
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
Application.EnableEvents = False
If Not Application.Intersect(Target, Range("J1:J65000")) Is Nothing Then
If Selection.Value <> "DONE" Then
Selection.Value = "DONE"
Range("A" & Selection.Row & ":J" & Selection.Row).Interior.ColorIndex =
56
Else
Selection.Value = ""
Range("A" & Selection.Row & ":J" & Selection.Row).Interior.ColorIndex =
xlNone
End If
End If
Application.EnableEvents = True
End Sub