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

Otto

"you the man" !!!!!!!!!!!!

I took out one of the private sub lines and all works fine!!


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



Thanks ever so much

"Billjary" wrote:

Otto

Thanks very much. This idea is exactly what i need. I do have one problem
tho. I've added exactly as you have entered it below following your
instructions. I am getting a compile error :

Ambiguous name detected: Worksheet_Change

Can you help??

Thanks again

"Otto Moehrbach" wrote:

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