LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 586
Default Disable all Control Events on a Userform when it is Intialized

I have a Userform with 17 Checkboxes. Each checkbox has a Click Event that
calls another procedure to calculate values to be displayed in Textboxes on
the Userform depending if the checkbox is true or false. The checkbox value
is determined by values on a particular row in a worksheet. When the
userform is initialized it runs this calculation 17 different times. Is there
a way to disable the events while the form intializes and then when all
values are deterimined in the Userform, then run the Click events? Currently
it is not slow, I was just wondering if it would be faster.

Here is a shortened version of my code. I tried doing this but when I
stepped thru the code it still fires the events.

Private Sub Worksheet_BeforeDoubleClick(ByVal Target As Range, Cancel As
Boolean)

With Userform
Checkbox1 = Cells(ActiveCell.Row, "A")
' then Checkbox1_Click Event Fires
Checkbox2 = Cells(ActiveCell.Row, "A")
' then Checkbox2_Click Event Fires
End With

Application.EnableEvents = True

Userform.Show

End Sub

Private Sub UserForm_Initialize()

' load list boxes and other stuff

Application.EnableEvents = False

End Sub
--
Cheers,
Ryan
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Events won't Disable! roadkill Excel Discussion (Misc queries) 2 April 26th 06 04:36 PM
Disable events Nigel Excel Programming 2 January 9th 06 06:40 AM
disable events does not work Mika Excel Programming 3 October 15th 05 02:09 PM
Disable Events wiwi Excel Programming 3 December 29th 03 04:53 PM
Disable Key Events Seth[_3_] Excel Programming 1 October 6th 03 10:28 PM


All times are GMT +1. The time now is 06:56 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"