View Single Post
  #5   Report Post  
Posted to microsoft.public.excel.misc
Otto Moehrbach
 
Posts: n/a
Default Adding colours as a function

If you want to change the entire row to red, you will need VBA. Put the
macro below in the sheet module for your sheet. To access that module,
right-click on the sheet tab, select View Code, and paste this macro into
that module. Click on the "X" in the top right corner to get back to your
sheet.
This macro will color the entire row red if the corresponding cell in
Column G goes to zero or less. It will remove the red color if the value
goes above zero. HTH Otto
Private Sub Worksheet_Change(ByVal Target As Range)
Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Column = 7 Then
If Target.Value <= 0 Then
Target.EntireRow.Interior.ColorIndex = 3
Else
Target.EntireRow.Interior.ColorIndex = xlNone
End If
End If
End Sub

"Billjary" wrote in message
...
hi

Is it possible to highlight a row when a particular cell reaches zero??
For
example if my stock level of oranges in col G reaches zero after orders
are
placed then can i run something that will automatically change that row to
red?

Thanks