View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Bob Phillips[_6_] Bob Phillips[_6_] is offline
external usenet poster
 
Posts: 11,272
Default 2 conditions in Worksheet_Change event

David,

You're not looking are you? The answer is already in the code, use

If Intersect(Target, Range("C5:C35")) Is Nothing Then Target.Offset(0,
2).Select

--

HTH

Bob Phillips
... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)

"David" wrote in message
...
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?

--
David