Changing color of a row when typed in...

[Closed]
Report
Posts
3
Registration date
Monday August 27, 2012
Status
Member
Last seen
August 28, 2012
-
Posts
3
Registration date
Monday August 27, 2012
Status
Member
Last seen
August 28, 2012
-
Hello,

I'm making an excel spreadsheet. What I'm wanting to do is have a row turn red if I type something in the first cell.

For example: If I type something in A2, I want cells A2:R2 to turn red.

I've tried to search through some other questions, but cannot find my way through this. I don't know if I need to do an IF formula or Conditional Formatting. Please help!

2 replies

Posts
1862
Registration date
Sunday June 14, 2009
Status
Contributor
Last seen
July 30, 2015
800
you need an EVENT HANDLER

RIGHT CLICK THE TAB OF THE PARTICULAR SHEET
CLICK VIEW CODE

in the window that opens copy this event code

Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Column <> 1 Then Exit Sub
Application.EnableEvents = False
Range(Target, Cells(Target.Row, "R")).Interior.ColorIndex = 3
Application.EnableEvents = True
End Sub


save the file

NOW GO TO THE SHEET SOMETHING IN ANY CELL IN COLUMN A
1
Thank you

A few words of thanks would be greatly appreciated. Add comment

CCM 2942 users have said thank you to us this month

Posts
3
Registration date
Monday August 27, 2012
Status
Member
Last seen
August 28, 2012

That worked great! The row turns red once I type in it. But if I delete what I typed to turn the row red, the row remains red. Is there any way to make it "un-highlight" the row once something is deleted from the cells in column A?
Posts
3
Registration date
Monday August 27, 2012
Status
Member
Last seen
August 28, 2012

That worked great! The row turns red once I type in it. But if I delete what I typed to turn the row red, the row remains red.

Is there any way to make it "un-highlight" the row once something is deleted from the cells in column A?

Subscribe To Our Newsletter!

The Best of CCM in Your Inbox

Subscribe To Our Newsletter!