Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Checkbox in ribbon

Status
Not open for further replies.

wmbb

Technical User
Jul 17, 2005
320
NL
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 ?
 
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 ;-)

 
So what does this code do?
Code:
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.

Skip,
[sub]
[glasses]Just traded in my OLD subtlety...
for a NUance![tongue][/sub]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top