+ Reply to Thread
Results 1 to 12 of 12

Protect sheets with same cell ranges simultaneously

  1. #1
    Forum Contributor G.Bregvadze's Avatar
    Join Date
    12-06-2012
    Location
    Georgia
    MS-Off Ver
    Excel 2010 - 2016
    Posts
    256

    Protect sheets with same cell ranges simultaneously

    Hi,

    I have many sheets, with same formatting and same cell ranges and need to protect locked cells in each sheet.

    As I have same number and same cells locked in each sheet, is there any possibility to protect same ranges in all sheets simultaneously?

  2. #2
    Forum Guru
    Join Date
    03-12-2010
    Location
    Canada
    MS-Off Ver
    2010 and 2013
    Posts
    4,418

    Re: Protect sheets with same cell ranges simultaneously

    Hi,

    What's the range, and do you want a password? If you want a password, do you want each worksheet to have a password or a master password? If individual passwords, do you want a master password?

    I can look at this again later this afternoon, but these are all valid issues that may come up with protection.

    abousetta
    Please consider:

    Thanking those who helped you. Click the star icon in the lower left part of the contributor's post and add Reputation.
    Cleaning up when you're done. Mark your thread [SOLVED] if you received your answer.

  3. #3
    Forum Contributor G.Bregvadze's Avatar
    Join Date
    12-06-2012
    Location
    Georgia
    MS-Off Ver
    Excel 2010 - 2016
    Posts
    256

    Re: Protect sheets with same cell ranges simultaneously

    The locked cells are for example B1:C10, the same sheet has C30:C45 and so on, but each sheet must lock same ranges and consequently, protect same ranges. Each sheet must have password locked protection and each sheet should have same password, for example 123.

  4. #4
    Forum Guru
    Join Date
    03-12-2010
    Location
    Canada
    MS-Off Ver
    2010 and 2013
    Posts
    4,418

    Re: Protect sheets with same cell ranges simultaneously

    Hi,

    Try this in ThisWorkbook:
    Please Login or Register  to view this content.
    abousetta
    Last edited by abousetta; 05-27-2013 at 02:54 PM. Reason: covnerted the shorthand to full words

  5. #5
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2003, 2010
    Posts
    40,678

    Re: Protect sheets with same cell ranges simultaneously

    Dim s%
    For shame!
    Entia non sunt multiplicanda sine necessitate

  6. #6
    Forum Guru
    Join Date
    03-12-2010
    Location
    Canada
    MS-Off Ver
    2010 and 2013
    Posts
    4,418

    Re: Protect sheets with same cell ranges simultaneously

    Shame me not... replaced the shorthand with the full word

  7. #7
    Forum Contributor G.Bregvadze's Avatar
    Join Date
    12-06-2012
    Location
    Georgia
    MS-Off Ver
    Excel 2010 - 2016
    Posts
    256

    Re: Protect sheets with same cell ranges simultaneously

    woow, thank you for your response. Just one more quesiton is there any possibility to indicate several ranges, as I have mentioned the workssheet contains severla ranges that must be locked and protected.

  8. #8
    Forum Guru
    Join Date
    03-12-2010
    Location
    Canada
    MS-Off Ver
    2010 and 2013
    Posts
    4,418

    Re: Protect sheets with same cell ranges simultaneously

    Try this:

    Please Login or Register  to view this content.
    abousetta

  9. #9
    Forum Contributor G.Bregvadze's Avatar
    Join Date
    12-06-2012
    Location
    Georgia
    MS-Off Ver
    Excel 2010 - 2016
    Posts
    256

    Re: Protect sheets with same cell ranges simultaneously

    Everyhing work great, thank you very much for your response, thank you again.

    Just one more question, As I am a new to VBA, I want to understand when it is needed to post code in Workbook, in specific sheet or insert it using Insert>Module?
    Last edited by G.Bregvadze; 05-28-2013 at 08:00 AM.

  10. #10
    Forum Guru
    Join Date
    03-12-2010
    Location
    Canada
    MS-Off Ver
    2010 and 2013
    Posts
    4,418

    Re: Protect sheets with same cell ranges simultaneously

    Without going into too many details, the VBA project consists of modules. They could be sheet-level modules, standard modules, userforms, etc. Excel also has a workbook-level module (i.e., ThisWorkbook). Each has a purpose (e.g. do something on opening or closing the workbook goes under ThisWorkbook). Most code you will find will be a standard module unless else specified.

    abousetta

  11. #11
    Forum Contributor G.Bregvadze's Avatar
    Join Date
    12-06-2012
    Location
    Georgia
    MS-Off Ver
    Excel 2010 - 2016
    Posts
    256

    Re: Protect sheets with same cell ranges simultaneously

    thanks again, gtreat job...

  12. #12
    Forum Guru
    Join Date
    03-12-2010
    Location
    Canada
    MS-Off Ver
    2010 and 2013
    Posts
    4,418

    Re: Protect sheets with same cell ranges simultaneously

    Hi,

    If you have specific ranges for each sheet then you can hard code them individually as follows:

    Please Login or Register  to view this content.
    You can also put all the sheet names or numbers in an array and the ranges you want locked in a second array and use the array elements in the code. Even though the code would be shorter, it will be more difficult for you to maintain or adapt.

    Hope this helps.

    abousetta
    Last edited by abousetta; 05-29-2013 at 05:00 AM.

+ 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