View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.programming
Toppers Toppers is offline
external usenet poster
 
Posts: 4,339
Default Mental Block! - Event Change Conditional Formatting

Hi,
try

Private Sub Worksheet_Change(ByVal Target As Range)
On Error GoTo ExitSub
Application.EnableEvents = False
If Not Intersect(Target, Range("G:L")) Is Nothing Then
With Target
If Not IsEmpty(.Value) And IsNumeric(.Value) Then
If .Value < 1 Then
.Font.ColorIndex = 3
End If
End If
End With
End If
ExitSub:
Application.EnableEvents = True
End Sub


HTH

" wrote:

Please put me out my misery folkes.
I have a range of data of which I want to conditional format the
numbers in columns G to L inclusive (yes the columns also contain
text).
I want to do something along the lines of :-

Private Sub Worksheet_SelectionChange(ByVal Target As Range)
Target = Columns("G:L")
If Target.Value < 1 Then
Selection.Font.ColorIndex = 3
End If
End Sub

I know this syntax is wrong but hopefully it shows you what I'm after.I
know I will have to add an IsNumber in there also, but my main question
is how you reference the Target to what you want it to be.

thanks folkes.
Donna