View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Piotr Lipski Piotr Lipski is offline
external usenet poster
 
Posts: 36
Default Row colour change on input

On Fri, 23 Jun 2006 05:21:11 -0500, CarolineHedges wrote:

I would like to know how I can get the colour of a row to automatically
change when a certain value is input, or any value at all into that
column.


Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Count = 1 Then
If Target.Column = 1 Then
Select Case Target.Value
Case "g"
Target.EntireRow.Interior.Color = vbGreen
Case "b"
Target.EntireRow.Interior.Color = vbBlue
Case "r"
Target.EntireRow.Interior.Color = vbRed
Case Else
Target.EntireRow.Interior.Color = vbWhite
End Select
End If
End If
End Sub

--
PL