Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Row Colouring depending on value in column L 1

Status
Not open for further replies.

robcarr

Programmer
May 15, 2002
633
GB
Dear All,

Is it possible to change the colours of all columns in the same row, if column L has either Green or Red entered in to it, these are the only 2 values in Column L and the whole row needs to be red or green depending on value in column L.

I think it is a worksheet change event, but all I keep getting is errors, when I select other cells.

I am sure some one has done this before.

Any help/coding greatly appreciated. Thanks Rob.[yoda]
 
This should do the trick for you - just put it in the worksheet module

Private Sub Worksheet_Change(ByVal Target As Excel.Range)
If Target.Column <> 12 Then
Exit Sub
Else
Select Case UCase(Target.Text)
Case &quot;GREEN&quot;
Rows(Target.Row).Interior.ColorIndex = 4
Case &quot;RED&quot;
Rows(Target.Row).Interior.ColorIndex = 3
Case Else
End Select
End If
End Sub Rgds
Geoff
&quot;Some cause happiness wherever they go; others whenever they go.&quot;
-Oscar Wilde
 
exactly what I wanted. Thanks Thanks Rob.[yoda]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top