Thread: Highlight rows
View Single Post
  #4   Report Post  
Posted to microsoft.public.excel.programming
Frank Kabel Frank Kabel is offline
external usenet poster
 
Posts: 3,885
Default Highlight rows

Hi
I don't see a problem as the events are enabled again at the end of
this code (also in case of an error)

--
Regards
Frank Kabel
Frankfurt, Germany
"B.Dryden" schrieb im Newsbeitrag
...

-----Original Message-----

I would like to make the entire row background color

yellow when checked.





Private Sub Worksheet_SelectionChange(ByVal Target As

Range)
Application.EnableEvents = False
On Error GoTo sub_exit
If Not Intersect(Target, Range("A1:A100")) Is Nothing

Then
With Target
If .Value = "a" Then
.Value = ""
Else
.Value = "a"
.Font.Name = "Marlett"
&! nbsp; End If
End With
End If
sub_exit:
Application.EnableEvents = True
End Sub


.
By setting EnableEvents to false at the beggining of your

procedure you have disabled your code since you are using
the SelectionChange event of the worksheet.
SelectionChange is of course an event by definition and
you have turned it off by setting EnableEvents to false.
Don't set EnableEvents to false and that should fix your
problem..