Events (not) disabled

C

chemicals

I have several textboxes on a MultiPage. Each one has a Change Event
handler. I am setting all Application Events to False then reading several
values from a worksheet onto the UserForm and fillling in those textboxes.
It still calls the event handlers???? Anyone see why this is happening? It
seems that once Me.txtAttendance.Value is set the Change handler is
called.....

Here is a Change handler:
Private Sub txtAttendance_Change()
CheckRange
End Sub

Here is the code that disables events:
Sub CopyValuesFromSheet(wsName As String)

With Application
.ScreenUpdating = False
.EnableEvents = False
End With
 
B

Bernie Deitrick

As you might guess from the code, ApplicationEnableEvents = False disables application (the main
Excel application), not userform events.

You could use

Private Sub txtAttendance_Change()
If Application.EnableEvents Then CheckRange
End Sub

HTH,
Bernie
MS Excel MVP
 
C

chemicals

Thanks Bernie. I thought that all Application events included the Userform
events (which is technically part of the application). Oh well.... :(
 

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