Can I update User Form CheckMark without running _Click code...?

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi,
During form initialization, I want to set values of certian check marks
based on what columns are hidden in a workbook.

The checkmark_Click routine has code but I don't want to run it when I
assign the value on ititialization.

Is there a way to do this?
I tried chkMark.value and also tried disableing events but that didn't work
either.

Any help would be appreciated.

Thanks,
MikeZz
 
If you really disabled events, how did the checkmark_Click event fire ?

Something wrong with your code I suspect.

NickHK
 
Hi Mike,

The EnableEvents property ha no effect on
Userform events.

Try using a module level variable selectively to
disable the event(s) of interest.

For example, try:

'=============>>
Option Explicit

Private blDisable As Boolean

'------------------>>
Private Sub UserForm_Initialize()
blDisable = True
Me.CheckBox1.Value = True
blDisable = False
End Sub

'------------------>>
Private Sub CheckBox1_Click()
If blDisable Then
Exit Sub
End If
'your code, e.g.:
MsgBox "Hi"
End Sub
'<<=============
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top