Checkboxes issues

KittyS

New Member
Joined
May 25, 2012
Messages
18
Hi,

I have a file with multiple worksheets (tabs). The checkboxes can be filled in one sheet, and are also visible on another. But on this other tab, they may not be altered! I have code like this:
Sub CheckBox3_Click()
'ga film
Worksheets("Products").Select
Range("b13").Select
If ActiveSheet.Shapes("Check Box 3").ControlFormat.Value = True Then
MsgBox "Checked! Changes only allowed by Branch Office."
ActiveSheet.Shapes("Check Box 3").ControlFormat.Value = False
Else
MsgBox "Unchecked! Changes only allowed by Branch Office."
ActiveSheet.Shapes("Check Box 3").ControlFormat.Value = False
End If

End Sub
It never seems to read the first "if", it always goes straight to the "Else" condition. Can anyone please help? Thanks!!! Kitty
 

Excel Facts

Difference between two dates
Secret function! Use =DATEDIF(A2,B2,"Y")&" years"&=DATEDIF(A2,B2,"YM")&" months"&=DATEDIF(A2,B2,"MD")&" days"
Kitty

Change ActiveSheet to Worksheets("Sheet3") or whatever.
 
Upvote 0
Try changing the line below:-
Code:
If ActiveSheet.Shapes("Check Box 3").ControlFormat.Value > 0 Then
 
Upvote 0
Thanks Mick and Norie, the "if" routine now works, but actually I need it to prevent the checkbox to be changed on this particular worksheet. And that still doesn't work like this.. it keeps accepting the change. I also tried "checkbox3_change" but that doesn't work. Somehow I need to keep the checkboxes visible but not changeable from this sheet. Any more ideas?
Thanks for you help with this!

Kitty
 
Upvote 0
Have you tried protecting the sheet with the review ribbon? You will need to lock the cell in format cells first.
 
Upvote 0
Thanks Mick and Norie, the "if" routine now works, but actually I need it to prevent the checkbox to be changed on this particular worksheet. And that still doesn't work like this.. it keeps accepting the change. I also tried "checkbox3_change" but that doesn't work. Somehow I need to keep the checkboxes visible but not changeable from this sheet. Any more ideas?
Thanks for you help with this!

Kitty
 
Upvote 0
Hi, Yes I did, but that doesn't work. I can only protect the source sheet for the check boxes but then all changes from all worksheets for the checkboxes don't work....
 
Upvote 0
Perhaps something like:-
Code:
Sub CheckBox3_Click()
With ActiveSheet.Shapes("Check Box 3").ControlFormat
   If .Value > 0 Then
        .Value = False
   Else
        .Value = True
   End If
End With
MsgBox "The CheckBox Cannot be changed !!!"
End Sub
 
Upvote 0
I reverted to not having the checkboxes on the other sheet, but just a conditional formatting based on the contents True/False of the initial checkboxes. Did the trick. Thanks all for your suggestions!!! :)
 
Upvote 0

Forum statistics

Threads
1,223,155
Messages
6,170,403
Members
452,325
Latest member
BlahQz

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top