ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   disable combo change event temporaraly (https://www.excelbanter.com/excel-programming/427736-disable-combo-change-event-temporaraly.html)

sunilpatel

disable combo change event temporaraly
 
Application.EnableEvents = False

With ActiveSheet.ComboBox1
.ListIndex = 0 'this line does not seem to
disable 'Private Sub ComboBox1_Change()
.Visible = True
.Activate
End With

how can i remedy this pleas



Jon Peltier

disable combo change event temporaraly
 
Use

Application.EnableEvents = False

and

Application.EnableEvents = True

around the code in the first procedure. Then set up the other procedure like
this:

Private Sub ComboBox1_Change()
If Application.EnableEvents Then
' code here only runs if EnableEvents = True

End If
End Sub


- Jon
-------
Jon Peltier, Peltier Technical Services, Inc.
http://PeltierTech.com/WordPress/
Advanced Excel Conference - June 17-18 2009 - Charting and Programming
http://peltiertech.com/Training/2009...00906ACNJ.html
_______



"sunilpatel" wrote in message
...
Application.EnableEvents = False

With ActiveSheet.ComboBox1
.ListIndex = 0 'this line does not seem to
disable 'Private Sub ComboBox1_Change()
.Visible = True
.Activate
End With

how can i remedy this pleas





All times are GMT +1. The time now is 12:51 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com