View Single Post
  #4   Report Post  
Posted to microsoft.public.excel.programming
David David is offline
external usenet poster
 
Posts: 195
Default 2 conditions in Worksheet_Change event

David wrote

I currently use this workaround which works:

Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Column = 3 Then Target.Offset(0, 2).Select
If Target.Count 1 Then Exit Sub
If Intersect(Target, Range("E5:E35")) Is Nothing Then Exit Sub
If Target.Value 1 Then
'---continue sub

I would like the input range in Column C to be limited to "C5:E35"
e.g. If Intersect(Target, Range("C5:C35")) Then Target.Offset(0,
2).Select

This gets me to desired cell in Column E, but then things bomb
'Runtime error 91' as soon as I input anything in "E5:E35"

How to fix?


This works the way I want:
If Not Intersect(Target, Range("C5:C35")) Is Nothing Then Target.Offset(0,
2).Select

--
David