98.7% Of all customers recommend us, we're so confident about our results we publish all reviews and stats
View Live Stats View ReviewsForum home » Delegate support and help forum » Microsoft Excel Training and help » excel+courses - Macros
excel+courses - Macros
Resolved · Low Priority · Version Standard
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
-------
Attached files...
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
Any suggestions, questions or comments? Please post in the Improve the forum thread. |
Excel tip:Conditional Formatting in Excel 2010If you have lots of data in a spreadsheet, you may find that it is easier to read if you highlight some of the values. This is Conditional Formatting and here's how to use it: |