Hello
I am using Excel 2010.
I have a workbook where the number of worksheets that I need to make "read only" will vary with each project.
I want to create a toggle button to freeze and unfreeze these pages with a password...it will always be where I freeze all or unfreeze all, never singlular worksheets.
I recorded the macro on one sheet and got the following code:
How do I translate this into VBA code for my toggle button to include all worksheets of my workbook? Thanks.
I am using Excel 2010.
I have a workbook where the number of worksheets that I need to make "read only" will vary with each project.
I want to create a toggle button to freeze and unfreeze these pages with a password...it will always be where I freeze all or unfreeze all, never singlular worksheets.
I recorded the macro on one sheet and got the following code:
Code:
sub test()
Sheets("1").Select
ActiveSheet.Protect DrawingObjects:=True, Contents:=True, Scenarios:=True
ActiveSheet.EnableSelection=xlNoSelection
End Sub
How do I translate this into VBA code for my toggle button to include all worksheets of my workbook? Thanks.