Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 87
Default Checkbox Lock

I am a new programmer in excel. I need lock the checkbox after checkbox
checked. I tried use property locked, enabled no one works. I used click
event. Need help. Thanks.




  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,758
Default Checkbox Lock

Maybe you could just disable it from future use:

Option Explicit
Private Sub CheckBox1_Click()
If Me.CheckBox1.Value = True Then
Me.CheckBox1.Enabled = False
End If
End Sub



Leanne wrote:

I am a new programmer in excel. I need lock the checkbox after checkbox
checked. I tried use property locked, enabled no one works. I used click
event. Need help. Thanks.


--

Dave Peterson
  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,758
Default Checkbox Lock

But I'd hate to see that (as a user). I often click on the wrong checkbox and
have to correct it.

Leanne wrote:

I am a new programmer in excel. I need lock the checkbox after checkbox
checked. I tried use property locked, enabled no one works. I used click
event. Need help. Thanks.


--

Dave Peterson
  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,302
Default Checkbox Lock

Hi Leanne,

Adapting Dave's code to acknowledge his warning, perhaps try:

Private Sub CheckBox1_Click()
Dim res As Long
If Me.CheckBox1.Value = True Then
res = MsgBox("Are you sure you meant to " & _
"check this option?", vbYesNo, "Please Confirm")
If res = vbYes Then
Me.CheckBox1.Enabled = False
Else
Me.CheckBox1.Value = False
End If
End If

End Sub

This throws up a message box if the user checks the box and asks for
confirmation. Annoying, if the box was intentionally checked, but less
annoying, perhaps, than being unable to undo an unintentional click.

---
Regards,
Norman



"Leanne" wrote in message
...
I am a new programmer in excel. I need lock the checkbox after checkbox
checked. I tried use property locked, enabled no one works. I used click
event. Need help. Thanks.






Reply
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
How to lock the Ctrl key? (as locking the Shift key w/Caps Lock) Rick-cel Excel Discussion (Misc queries) 2 August 5th 09 06:45 PM
how do I undo the scroll lock, thscroll lock button does not work scroll lock Excel Discussion (Misc queries) 3 July 19th 08 10:17 PM
How to have Checkbox A uncheck with checked Checkbox B Texas Aggie Excel Discussion (Misc queries) 3 July 20th 07 10:58 PM
I have lock a wookbook but one cell does not want to lock it Mimi Excel Discussion (Misc queries) 2 January 21st 07 10:59 PM
I have lock a wookbook but one cell does not want to lock it Mimi Excel Discussion (Misc queries) 1 January 21st 07 09:44 AM


All times are GMT +1. The time now is 11:49 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"