+ Reply to Thread
Results 1 to 6 of 6

VBA for protecting certain sheets with editing

  1. #1
    Forum Contributor
    Join Date
    03-16-2012
    Location
    Halifax, UK
    MS-Off Ver
    MS Office 365
    Posts
    206

    VBA for protecting certain sheets with editing

    Hi
    I have a large excel file with about 100 sheets in for a report.
    There is an Admin 'lock all' & 'unlock all' button on the input sheet which lock and unlock all the sheets.
    When the sheets are locked for use by the engineers I need 5 of these sheets to be able to paste and edit photos in.
    I have got the code to work and all 5 sheets can have photos pasted in now.

    Is there a way of condensing the code so I haven't 5 lots of the same code repeated? I have tried a few different ways but can't get it to work.

    Please Login or Register  to view this content.
    I've tried these:

    Please Login or Register  to view this content.
    Please Login or Register  to view this content.
    And a few other ways similar to these.

    Kieran

  2. #2
    Forum Expert Mumps1's Avatar
    Join Date
    10-10-2012
    Location
    Toronto, Canada
    MS-Off Ver
    Excel 2010, 365
    Posts
    8,052

    Re: VBA for protecting certain sheets with editing

    Try:
    Please Login or Register  to view this content.
    You can say "THANK YOU" for help received by clicking the Star symbol at the bottom left of the helper's post.
    Practice makes perfect. I'm very far from perfect so I'm still practising.

  3. #3
    Forum Expert
    Join Date
    11-22-2016
    Location
    Cornwall,UK
    MS-Off Ver
    office 365
    Posts
    4,240

    Re: VBA for protecting certain sheets with editing

    This is very similar to the code posted by Mumps1
    - instead of putting sheet names in an array
    - they are listed in a "Select Case" scenario

    Please Login or Register  to view this content.
    Click *Add Reputation to thank those who helped you. Ask if anything is not clear

  4. #4
    Forum Contributor
    Join Date
    03-16-2012
    Location
    Halifax, UK
    MS-Off Ver
    MS Office 365
    Posts
    206

    Re: VBA for protecting certain sheets with editing

    Thanks Guys, they both worked great.

  5. #5
    Forum Expert
    Join Date
    11-22-2016
    Location
    Cornwall,UK
    MS-Off Ver
    office 365
    Posts
    4,240

    Re: VBA for protecting certain sheets with editing

    you are welcome

    to mark thread SOLVED click on ThreadTools at top of thread

  6. #6
    Forum Expert Mumps1's Avatar
    Join Date
    10-10-2012
    Location
    Toronto, Canada
    MS-Off Ver
    Excel 2010, 365
    Posts
    8,052

    Re: VBA for protecting certain sheets with editing

    Glad to help.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Autolocking cell after entering number and protecting the cell from editing
    By batya in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 08-08-2014, 06:22 AM
  2. Protecting tabs and protecting sheets
    By jimstrongy in forum Excel General
    Replies: 0
    Last Post: 01-31-2012, 11:27 AM
  3. Replies: 2
    Last Post: 10-25-2009, 04:04 PM
  4. Disable Editing a Cell Without Protecting the Worksheet
    By akabraha in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 06-02-2008, 06:46 PM
  5. protecting cells against editing by copy/paste actions
    By grigoras victor in forum Excel General
    Replies: 0
    Last Post: 06-20-2006, 05:40 AM
  6. protecting cells against editing by copy/paste actions
    By grigoras victor in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 06-20-2006, 05:40 AM
  7. protecting cells against editing by copy/paste actions
    By grigoras victor in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 06-20-2006, 05:40 AM

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