View Single Post
  #5   Report Post  
Posted to microsoft.public.excel.programming
Sandy Sandy is offline
external usenet poster
 
Posts: 270
Default Worksheet_Change not changing

James
1. The sub is in "Sheet1(Sheet1)" which is the sheet the data is on.
2. Events turned on ????
3. ("C9:K9,M9:U9") contains integers varying between 2 and 6. I change say a
4 to a 3 or vice versa and nothing occurs.
Sandy

"Zone" wrote in message
...
Sandy,
1. Do you have the subroutine in the worksheet module for the worksheet
that's being changed?
2. Are events turned on?
3. How are you making a change to the worksheet?
James
"Sandy" wrote in message
...
Why does this code not run when the worksheet changes?
It will run correctly if I change the first line to:-
"Private Sub Work()" and then run it manually.
Sandy

Private Sub Worksheet_Change(ByVal Target As Range)

Application.ScreenUpdating = False
Application.EnableEvents = False

For Each mycell In Range("C14:K14,M14:U14")
With mycell
If mycell.Offset(-5).Value = 3 Then
.Value = "Miss"
ElseIf mycell.Offset(-5).Value < 3 Then
mycell.Value = "Hit"
End If
End With
Next mycell

Application.ScreenUpdating = True
Application.EnableEvents = True

End Sub