ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Storing macros in one workbook (https://www.excelbanter.com/excel-programming/386486-storing-macros-one-workbook.html)

DeeW

Storing macros in one workbook
 
I followed the instructions posted to Protect All Worksheets in a Workbook:

Sub Protect_All_Sheets()
Dim ws As Worksheet
For Each ws In ThisWorkbook.Worksheets
ws.Protect password:="123"
Next ws
End Sub

This worked well. Now I need to add this to the Personal Macros Workbook so
that it is accessible for other workbooks. How can this be done?



David McRitchie

Storing macros in one workbook
 
Add the macro to your personal.xls workbook and then
hide (window, hide) the personal.xls workbook. It will
be availablt to all open workbooks as personal.xls!Protect_All_Sheets

For more information see
http://www.mvps.org/dmcritchie/excel/install.htm
---
HTH,
David McRitchie, Microsoft MVP - Excel
My Excel Pages: http://www.mvps.org/dmcritchie/excel/excel.htm
Search Page: http://www.mvps.org/dmcritchie/excel/search.htm

"DeeW" wrote in message ...
I followed the instructions posted to Protect All Worksheets in a Workbook:

Sub Protect_All_Sheets()
Dim ws As Worksheet
For Each ws In ThisWorkbook.Worksheets
ws.Protect password:="123"
Next ws
End Sub

This worked well. Now I need to add this to the Personal Macros Workbook so
that it is accessible for other workbooks. How can this be done?






All times are GMT +1. The time now is 12:45 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com