ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   disable event (https://www.excelbanter.com/excel-programming/389247-disable-event.html)

clara

disable event
 
Hi all,

How to disable a change event when a control is assigned a value.

Clara
--
thank you so much for your help

Susan

disable event
 
if ocontrol.value = true then
application.enableevents=false
'do your stuff
end if
application.enableevents=true

hth!
susan


On May 11, 12:18 pm, clara wrote:
Hi all,

How to disable a change event when a control is assigned a value.

Clara
--
thank you so much for your help




clara

disable event
 
Hi Susan,

Thank you very much. What I mean is how to disable an change event on a form.

Clara
--
thank you so much for your help


"Susan" wrote:

if ocontrol.value = true then
application.enableevents=false
'do your stuff
end if
application.enableevents=true

hth!
susan


On May 11, 12:18 pm, clara wrote:
Hi all,

How to disable a change event when a control is assigned a value.

Clara
--
thank you so much for your help





Susan

disable event
 
hmmmmmmmmmmmm
the only way i can think of doing that is by making the change event
NOT a change event, and calling it with an if-statement.....
well, no, i don't think that will work, either. because you can't use
any kind of an if-statement, because the change event will trigger
before the coding gets to the if-statement.

i don't think you can, once you've written it, without commenting it
out!
:)
maybe you could make the change coding more variable with an if-
statement in it........

sub txtOne_change ()

if txtOne.value <0 then
call my_real_change_sub
end if

so then if it doesn't meet your qualifications, it simply won't do
anything.
i don't know if this will have an effect on your project, though, for
speed or size issues, because it will trigger every time you make a
change in that txtbox, but maybe only fire occasionally. i've done
similar things before in worksheet_changes, & it doesn't seem to
effect anything, but they haven't been big involved projects.
hth!
:)
susan



On May 11, 4:41 pm, clara wrote:
Hi Susan,

Thank you very much. What I mean is how to disable an change event on a form.

Clara
--
thank you so much for your help



"Susan" wrote:
if ocontrol.value = true then
application.enableevents=false
'do your stuff
end if
application.enableevents=true


hth!
susan


On May 11, 12:18 pm, clara wrote:
Hi all,


How to disable a change event when a control is assigned a value.


Clara
--
thank you so much for your help- Hide quoted text -


- Show quoted text -





All times are GMT +1. The time now is 11:58 PM.

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