View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.misc
mudraker
 
Posts: n/a
Default Conditional Fomatting 3 in code


Nuttychick

You was so close

This needs to go in the worksheet Module
Right Click on thew Sheet name tab
Select View Code
Paste the following into the worksheet module

Option Explicit

Private Sub Worksheet_Change(ByVal Target As Range)
'turn event trigger off whilst macro running
Application.EnableEvents = False
With Target
If .Column = 4 Then
Select Case .Value
Case 0 To 2.99
.EntireRow.Interior.ColorIndex = 4
Case 3 To 5.99
.EntireRow.Interior.ColorIndex = 6
Case 6 To 9.99
.EntireRow.Interior.ColorIndex = 39
Case 10 To 14.99
.EntireRow.Interior.ColorIndex = 41
Case Is = 15
.EntireRow.Interior.ColorIndex = 3
Case Else
.EntireRow.Interior.ColorIndex = 0
End Select
End If
'turn event trigger back on
Application.EnableEvents = True
End With
End Sub


--
mudraker
------------------------------------------------------------------------
mudraker's Profile: http://www.excelforum.com/member.php...fo&userid=2473
View this thread: http://www.excelforum.com/showthread...hreadid=539786