View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.programming
XR8 Sprintless XR8 Sprintless is offline
external usenet poster
 
Posts: 19
Default Conditional formatting with vba

On 15/02/2012 10:36 AM, Don Guillett wrote:
Worksheet change events are meant to change that cell or another cell
when that cell is changed. You really don't want a loop firing each
time you make any change. If you desire is to match the last contigous
cell in the column and turn blue if so or red if not then this will do
it and color the cell in colum B when you change column B. Probably
not what you really want??


Private Sub Worksheet_Change(ByVal Target As Range)
Target.Font.ColorIndex = 5' red
If Target.Column = 2 And Target.End(xlToRight) = Target _
Then Target.Font.ColorIndex = 3'blue
End Sub


Not exactly as I need. However I am thinking of another way I may be
able to get it to work.