+ Reply to Thread
Results 1 to 3 of 3

Marco to Lock/Unlock and Protect/Unprotect Multiple Excel Workbooks

  1. #1
    Registered User
    Join Date
    05-22-2013
    Location
    Texas
    MS-Off Ver
    Excel 2010
    Posts
    3

    Marco to Lock/Unlock and Protect/Unprotect Multiple Excel Workbooks

    I have a mundane task were I have to unprotect 72 excel workbooks at the beginning of each month and lock and protect them at the end of each month. These workbooks are shared and must be updated by certain users within a certain time period. I know that a VBA code can be written to automate this task, but I am new to VBA so I'm having trouble getting started. I do plan on taking an online VBA intro course in the next month. I’m hoping someone can provide some useful feedback on how I can automate this task or recommend a good excel vba book.

    thanks,

    Jesse

  2. #2
    Valued Forum Contributor
    Join Date
    11-20-2012
    Location
    Seattle, WA USA
    MS-Off Ver
    Excel 2010
    Posts
    597

    Re: Marco to Lock/Unlock and Protect/Unprotect Multiple Excel Workbooks

    you can replace ActiveSheet with the sheet name like Sheets("Sheet Name")

    also if you record a macro and protect the sheet with the parameters that you want it will give you the xyz:= True, abc:=True, efg:=False etc part of the code then you can add the Password:="put your password here" part of it in manually

    you don't really need a book per se, google has everything that you would ever need in the realm of VBA, if you take an online course they will provide a "textbook" which should suffice, plus this forum is a great resource

    if you have 72 workbooks you may want to look into creating a loop


    Protect a sheet:
    HTML Code: 
    Unprotect a sheet:
    HTML Code: 
    if you want to protect a whole workbook:
    HTML Code: 
    Unprotect whole workbook
    HTML Code: 

  3. #3
    Registered User
    Join Date
    05-22-2013
    Location
    Texas
    MS-Off Ver
    Excel 2010
    Posts
    3

    Re: Marco to Lock/Unlock and Protect/Unprotect Multiple Excel Workbooks

    This is exactly what I was looking for. Thank you!!!

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1