ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Can I update User Form CheckMark without running _Click code...? (https://www.excelbanter.com/excel-programming/390773-can-i-update-user-form-checkmark-without-running-_click-code.html)

MikeZz

Can I update User Form CheckMark without running _Click code...?
 
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

NickHK

Can I update User Form CheckMark without running _Click code...?
 
If you really disabled events, how did the checkmark_Click event fire ?

Something wrong with your code I suspect.

NickHK

"MikeZz" wrote in message
...
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




Norman Jones

Can I update User Form CheckMark without running _Click code...?
 
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
'<<=============



---
Regards,
Norman


"MikeZz" wrote in message
...
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





All times are GMT +1. The time now is 05:44 PM.

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