I'm not Chip, but If you put a break point in your code (right near the top),
then stepped through the code after the break, you'd see what was really
happening. Not quite what you expect. But with the speed of the pc (and the
code you're running), you don't notice the difference.
You can also see it by adding a single msgbox:
Option Explicit
Private Sub Worksheet_SelectionChange(ByVal Target As Range) 'macro jump cell
MsgBox "hi from worksheet change!"
If Target.Row = 12 And Target.Column = 7 Then 'jump A14
Target.Offset(2, -6).Select
End If
If Target.Row = 15 And Target.Column = 1 Then 'jump B14
Target.Offset(-1, 1).Select
End If
End Sub
And depending on what your code does, lots can go wrong or nothing can go, er,
look wrong.
Here's a worksheet_change event that looks like it would just add something to
the cell below the changed cell:
Option Explicit
Private Sub Worksheet_Change(ByVal Target As Range)
Target.Offset(1, 0) = "hi"
End Sub
But changing that cell below causes the event to fire, which causes the cell
below to change which causes the event to fire......until excel gets tired (it
does try to protect itself a little bit).
I changed A1 and excel got tired when it changed A227 (xl2003).
nsv wrote:
..but Chip, until now I have run my spreadsheet without the disabling
of events and it works perfectly. It is only a small one, actually just
a form to be filled out in certain cells only and there are almost no
calculations.
I will of course put in the extra lines you recommend, but what can go
wrong if I do not disable events?
NSV
--
nsv
------------------------------------------------------------------------
nsv's Profile: http://www.excelforum.com/member.php...o&userid=26500
View this thread: http://www.excelforum.com/showthread...hreadid=522094
--
Dave Peterson