peter has attended:
Excel Advanced course
Macros
can single macro apply to all worksheets of a workbook without activating for each worksheet. i.e. activate once for entire workbook
RE: macros
Hi Peter,
Thanks for your question. I have asked my colleague who does VBA to address this question, and will get back to you.
Rehards
Richard
RE: macros
Hi Peter
Try using this peice of VBA in a new module of the VBA editor.
It will set the password to 123, which you can change by simply editing the code below.
You can add your own macro buttons to your excel toolbar, and assign each macro.
I have also attached the example sheet so you can see it in action.
Regards
Richard
------------
Option Explicit
Sub Protectsheets()
Dim wsheet As Worksheet
For Each wsheet In ActiveWorkbook.Worksheets
wsheet.Protect password:="123"
Next wsheet
End Sub
Sub unprotectsheet()
Dim wsheet As Worksheet
Dim password As String
password = InputBox("Please enter the password")
For Each wsheet In ActiveWorkbook.Worksheets
wsheet.Unprotect password:=password
-------