Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hello
I have 3 textboxes on a form. I want to allow the user to change one of them and for the other 2 to automatically update. My code looks something like this: Box1_Change Box2.value = ........ Box3.value = ........ end However, when I set the values on the other boxes I start their Change methods and I end up in an infinite loop. I have tried an "Application.EnableEvents = False" to avoid this but it didn't work. Any ideas on how to avoid this situation? Thanks, Steve |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Steve,
EnableEvents does not function in UserForms. You can use a boolean flag to the same end however. Declare a private variable at the top of the form module.. Private blnEnable As Boolean In the Box1_Change code... Box1_Change blnEnable = True Box2.value = ........ Box3.value = ........ blnEnable = False End Sub At the start of the Box2 and Box3 change code... If blnEnable then Exit Sub -- Jim Cone San Francisco, USA http://www.realezsites.com/bus/primitivesoftware "Blue Aardvark" wrote in message Hello I have 3 textboxes on a form. I want to allow the user to change one of them and for the other 2 to automatically update. My code looks something like this: Box1_Change Box2.value = ........ Box3.value = ........ end However, when I set the values on the other boxes I start their Change methods and I end up in an infinite loop. I have tried an "Application.EnableEvents = False" to avoid this but it didn't work. Any ideas on how to avoid this situation? Thanks, Steve |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Events on controls generated on the fly... | Excel Programming | |||
Browse Forms Controls and change TextBox color based on cell color | Excel Programming | |||
Change events and linked cells | Excel Programming | |||
Add Controls With Events at Runtime | Excel Programming | |||
Events for Controls in a Multipage Control | Excel Programming |