Protection Macros--modify to allow format changes

V

Visakha

Hello. I am currently using the following macro:

Option Explicit
Sub UnprotectAll()
dim wks as worksheet
for each wks in activeworkbook.worksheets
wks.unprotect password:="topsecret"
next wks
End Sub
Sub ProtectAll()
dim wks as worksheet
for each wks in activeworkbook.worksheets
wks.protect password:="topsecret"
next wks
End Sub

I would like to be able to modify this macro so that end users can format
rows as needed. I am a beginnner macro user. Thanks in advance!
 
G

Gord Dibben

Sub ProtectAll()
Dim wks As Worksheet
For Each wks In ActiveWorkbook.Worksheets
wks.Protect Password:="topsecret", AllowFormattingRows:=True
Next wks
End Sub

To see all arguments enter wks.Protect, and Intellisense will show you all
the options.


Gord Dibben MS Excel MVP
 
V

Visakha

THANKS! This was very helpful!!

Gord Dibben said:
Sub ProtectAll()
Dim wks As Worksheet
For Each wks In ActiveWorkbook.Worksheets
wks.Protect Password:="topsecret", AllowFormattingRows:=True
Next wks
End Sub

To see all arguments enter wks.Protect, and Intellisense will show you all
the options.


Gord Dibben MS Excel MVP



.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top