Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!
  • Students Click Here

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here


Checkbox in ribbon

Checkbox in ribbon

Checkbox in ribbon

Is it possible to create a custom tab in excel containig a checkbox showing de protection state.
Checkbox checked if worksheet is protected and unchecked when worksheet is not protected.
I was thinking of a worksheet_activate procedure but how do I control the checkbox in the ribbon using vba ?

RE: Checkbox in ribbon

I already have created a custom tab containing a checkbox but I want to control the checkbox depending on the state of the active sheet....
Checkbox checked if worksheet is protected and unchecked when worksheet is not protected.

Something in code like:
If ActiveSheet.ProtectContents = True then ThisWorkbook.ribbon.controls("checkbox1").Checked = True
But then the correct code winky smile

RE: Checkbox in ribbon

So what does this code do?


ThisWorkbook.ribbon.controls("checkbox1").Checked = ActiveSheet.ProtectContents 

You could run the code in the WorkSheet_Acrivate Event.j

No doubt you've tried using the macro recorder to see what code is generated by checking/unchecking the box.


glassesJust traded in my OLD subtlety...
for a NUance!tongue

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members!

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close