change event

R

ranswert

I have the following code in a worksheet change event:

Private Sub Worksheet_Change(ByVal Target As Range)
On Error GoTo stoppit
Application.EnableEvents = False
enteritem
Application.EnableEvents = True
stoppit:


End Sub

It was working until I made some changes in the 'enteritem' procedure and
now nothing happen. I've put 'msgbox("")' in and nothing happens in this
worksheet or an anyother worksheets. How do I get them to work again?
Thanks
 
J

Jim Cone

It appears you need to set EnableEvents back to True...
'--
Sub ReturnToNormal
Application.EnableEvents = True
End Sub

Also, in your procedure, place the stoppit: line above the
Application.EnableEvents = True line.

Jim Cone
San Francisco, USA
http://www.realezsites.com/bus/primitivesoftware
(Excel Add-ins / Excel Programming)


"ranswert"
wrote in message
I have the following code in a worksheet change event:

Private Sub Worksheet_Change(ByVal Target As Range)
On Error GoTo stoppit
Application.EnableEvents = False
enteritem
Application.EnableEvents = True
stoppit:


End Sub

It was working until I made some changes in the 'enteritem' procedure and
now nothing happen. I've put 'msgbox("")' in and nothing happens in this
worksheet or an anyother worksheets. How do I get them to work again?
Thanks
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top