View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Sandy V[_4_] Sandy V[_4_] is offline
external usenet poster
 
Posts: 8
Default Sheet event doesn't work in '97

Your code works as expected for me in XL97. However are
you sure you want this in a "Worksheet_Change" event
rather than in "Worksheet_SelectionChange"

Not sure why you are disabling events. If events have not
been re-enabled for any reason that would disable your
event code. If you think your code is not working try
this in a normal module:

MsgBox Application.EnableEvents

Regards,
Sandy
savituk yahoo co uk

-----Original Message-----
Can anyone help?

I have the following code which works fine on 2000 but in

work we have '97
and the sheet event doesn't fire when selecting items

from a drop down
valuidation list in column F.

Private Sub Worksheet_Change(ByVal Target As Range)
Application.EnableEvents = False
On Error GoTo ws_exit
If Target.Column = 6 Then
If Target.Offset(0, -5).Value <= Worksheets

("Sheet2").Range("A1").Value
Then
If Right(Target.Value, 1) = "^" Then
MsgBox "Error, you must choose one without a

roof on!"
End If
ElseIf Target.Offset(0, -5).Value
Worksheets("Sheet2").Range("A1").Value Then
If Right(Target.Value, 1) < "^" Then
MsgBox "Error, you must choose one with a

roof on!"
End If
End If
End If
ws_exit:
Application.EnableEvents = True
End Sub

This check is very important, is there any other way to

do it?

Thanks in advance.

Gareth


.