macros
RH

Forum home » Delegate support and help forum » Microsoft Excel Training and help » Macros

Macros

resolvedResolved · Low Priority · Version 365

Susie has attended:
Excel Advanced course

Macros

a macro to protect a workbook page by page please?

RE: macros

Hi Susie,

Thank you for the forum question.

The macro below will protect all sheets in the workbook the code is executed in with the password myPassword. If you want another password change the password in the code.



Sub ProtectSheetsWithPassword()

'Protect worksheet with a password

For i=1 to Sheets.count
Sheets(i).Protect Password:="myPassword"
Next i

End Sub



The link below is to a website, where you can find a lot of vba protection options

https://exceloffthegrid.com/vba-code-worksheet-protection/

Kind regards

Jens Bonde
Microsoft Office Specialist Trainer

Tel: 0207 987 3777
STL - https://www.stl-training.co.uk
98%+ recommend us

London's leader with UK wide delivery in Microsoft Office training and management training to global brands, FTSE 100, SME's and the public sector

Thu 12 May 2022: Automatically marked as resolved.

 

Training courses

 

Training information:

See also:

Welcome. Please choose your application (eg. Excel) and then post your question.

Our Microsoft Qualified trainers will then respond within 24 hours (working days).

Frequently Asked Questions
What does 'Resolved' mean?

Any suggestions, questions or comments? Please post in the Improve the forum thread.


 

Excel tip:

Change the Default Width of All Columns in Excel 2010

If you want to change the width of the columns in your Excel 2010 spreadsheet, making them either larger or smaller, here's how:

In the Cells group on the Home tab, click Format.

Hover over the section called Cell Size and a drop down list will appear, select Default Width from this list.

In the Standard Width dialog box, enter the size you want to set as the default width and click OK.

View all Excel hints and tips


Server loaded in 0.05 secs.