View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
Ctech[_13_] Ctech[_13_] is offline
external usenet poster
 
Posts: 1
Default Coloring a range depending on a cell value


Mine colors the row of the cell with a value more then 0:

Its not the best as I have used If not ... but it works


Sub ChangeRowColor()
Dim Cell As Range

For Each Cell In Range("Q1:Q20")
If IsEmpty(Cell) Then GoTo EmptyCell

If Not Cell <= 0 Then
Cell.EntireRow.Select
With Selection.Interior
.ColorIndex = 3
.Pattern = xlSolid
End With
End If

Next Cell

EmptyCell:
MsgBox "All Suppliers with a positiv 'Grand Total' is now colored red"
End Su

--
Ctec
-----------------------------------------------------------------------
Ctech's Profile: http://www.excelforum.com/member.php...fo&userid=2774
View this thread: http://www.excelforum.com/showthread.php?threadid=47330