ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Row colour change on input (https://www.excelbanter.com/excel-programming/365181-row-colour-change-input.html)

CarolineHedges[_2_]

Row colour change on input
 

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.

Thanks

Caroline


--
CarolineHedges
------------------------------------------------------------------------
CarolineHedges's Profile: http://www.excelforum.com/member.php...o&userid=35705
View this thread: http://www.excelforum.com/showthread...hreadid=554908


Piotr Lipski

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


All times are GMT +1. The time now is 03:11 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com