View Single Post
  #5   Report Post  
Casey
 
Posts: n/a
Default


Jim,
Thank you so much for the help. I got what I needed with the Enable
Events. I tried running your code but it cleared the entire first 5
columns whenever I put a "1" in any row in the 6th column, not what I
was looking for. Below is the Code I pasted together with your input.
Two questions if you have time. One, is it necessary to change the N
varible data type to variant? Two is the error handling procedure
necessary, do I need to incorporate it into my revised code? Thanks
again Jim for the code and the cascading event lesson, I really
appreciate your time.

Here's my revised code which works great.

Private Sub Worksheet_Change(ByVal Target As Range)
Dim i As Integer
Dim N As Integer
Dim wks1 As Worksheet

Set wks1 = Worksheets("SET UP SHT(1)")
Application.EnableEvents = False

If Not Intersect(Target, Range("E23:J27")) Is Nothing Then

For i = 23 To 27
N = wks1.Cells(i, 10).Value
If N = 1 Then
Cells(i, 5) = 0
Cells(i, 6) = 0
Cells(i, 7) = 0
Cells(i, 8) = 0
Cells(i, 9) = 0
End If
Next i


End If
Application.EnableEvents = True
End Sub


--
Casey


------------------------------------------------------------------------
Casey's Profile: http://www.excelforum.com/member.php...fo&userid=4545
View this thread: http://www.excelforum.com/showthread...hreadid=472109