Application.enable
The enableevents setting is an setting in the Excel object library. Object
in the control toolbox toolbar are in the MS forms 2.0 library, so they have
no knowledge of nor are they governed by the EnableEvents setting. Only
Excel proper events adhere to this.
You will need to use a public boolean variable to allow events to terminate
upon entry when it is set. Therefore you code needs to set the variable to
true (a variable like
Public bBlockEvents as Boolean
Private Sub cmbGrade14_Change()
if bBlockEvents then exit sub
bBlockEvents = True
Call blockDataEntry(cmbGrade14, 14)
bBlockEvents = False
End Sub
as an example or perhaps you can do the setting and unsetting in
blockDataEntry.
--
Regards,
Tom Ogilvy
"MVM" wrote in message
...
When I change a value in a combobox, say 16th combobox
why is that 15 and then 14 code also run at the end of 16.
This is written in excel 2003 vba.
why applications.enableevents = false is not working
Any help is greatly appreciated.
MVM
---------------------------- code -------------
Private Sub cmbGrade14_Change()
Call blockDataEntry(cmbGrade14, 14)
End Sub
Private Sub cmbGrade15_Change()
Call blockDataEntry(cmbGrade15, 15)
End Sub
Private Sub cmbGrade16_Change()
Call blockDataEntry(cmbGrade16, 16)
End Sub
public sub blockDataEntry(c as combobox, r as integer)
Application.enableEvents = False
.......
Application.enableEvents = true
End Sub
|