+ Reply to Thread
Results 1 to 11 of 11

Disable copy of worksheets and renaming of certain sheets

  1. #1
    Registered User
    Join Date
    03-16-2020
    Location
    Perth
    MS-Off Ver
    365
    Posts
    78

    Disable copy of worksheets and renaming of certain sheets

    Hi guys,

    A- Is there a way to disable the copy of any worksheet in a workbook? As in via the right click Move or Copy option. I am OK with moving just not copying it.

    B - Is there a way to disable to move and copy function for a select group of sheets (4 sheets in total)?

    C- Also is there a way to disable the renaming of selected worksheets (4 Sheets in total)?

    Thank you.

  2. #2
    Forum Expert
    Join Date
    07-06-2004
    Location
    Northern California
    MS-Off Ver
    2K, 2003, 2010, O365
    Posts
    1,490

    Re: Disable copy of worksheets and renaming of certain sheets

    You can use workbook protection to protect the structure of a workbook. See the MSFT docs for details.

  3. #3
    Registered User
    Join Date
    03-16-2020
    Location
    Perth
    MS-Off Ver
    365
    Posts
    78

    Re: Disable copy of worksheets and renaming of certain sheets

    Yes, I am aware, but I want to be able to rename or move some sheets.

  4. #4
    Registered User
    Join Date
    03-16-2020
    Location
    Perth
    MS-Off Ver
    365
    Posts
    78

    Re: Disable copy of worksheets and renaming of certain sheets

    OK,
    so I seem to have found a way to protect the sheet name on selected sheets using the code below.

    Just paste it into the relevant sheet and change "Master" to suit your needs.

    It will allow you to type in a new name on the sheet, but as soon as you click on the sheet it reverts back to the desired name.

    If you can think of a better way, then by all means please share.

    PS: Still looking to disable the "copy sheet"?


    Please Login or Register  to view this content.

  5. #5
    Forum Expert
    Join Date
    07-06-2004
    Location
    Northern California
    MS-Off Ver
    2K, 2003, 2010, O365
    Posts
    1,490

    Re: Disable copy of worksheets and renaming of certain sheets

    Depends on the cleverness of one's users. Open a different workbook and run a macro including the statement

    Please Login or Register  to view this content.
    and your event handlers won't do anything.

    If you mean prohibit copying worksheets into other workbooks, you may need to look into DRM.

  6. #6
    Registered User
    Join Date
    03-16-2020
    Location
    Perth
    MS-Off Ver
    365
    Posts
    78

    Re: Disable copy of worksheets and renaming of certain sheets

    I added the following to the workbook, but didn't work.


    Please Login or Register  to view this content.
    I just don't want to copy any sheets within the same workbook.

    Thanks.
    Last edited by Lazarus Rises; 04-03-2021 at 11:47 PM.

  7. #7
    Registered User
    Join Date
    03-16-2020
    Location
    Perth
    MS-Off Ver
    365
    Posts
    78

    Re: Disable copy of worksheets and renaming of certain sheets

    Just bumping this up.

    Hoping someone has a solution to disable the copy of sheets.

  8. #8
    Forum Expert
    Join Date
    07-06-2004
    Location
    Northern California
    MS-Off Ver
    2K, 2003, 2010, O365
    Posts
    1,490

    Re: Disable copy of worksheets and renaming of certain sheets

    The only relatively robust way to prevent copying worksheets within the same workbook is to protect the workbook's structure.

    You could try to use event handlers, but it's EASY to disable event handlers. The point I tried to make earlier was that it's be EASY for perverse users to bypass any event handlers you use to try to prevent copying worksheets.

    If you want to allow rearranging worksheets but not copying worksheets within the same workbook, you may still need to protect the workbook's structure but also provide macros which would allow for rearranging worksheets. Such macros would prompt for where the user wants to move ActiveSheet, then unprotect the workbook, move ActiveSheet, and reprotect the workbook.

    At some point if you receive no other responses, you may either need to accept that what I've stated above is the case, no matter how much you don't like that and wish it were otherwise, or ask this in a different forum, such as StackOverflow, Reddit's /r/Excel, or MSFT's own community forums in hope that people other than those here might have ideas not forthcoming here.

  9. #9
    Registered User
    Join Date
    03-16-2020
    Location
    Perth
    MS-Off Ver
    365
    Posts
    78

    Re: Disable copy of worksheets and renaming of certain sheets

    hrIngrv,

    Thanks, I see what you mean.

    Would you be able to help with a sample macro that would prompt the active sheet to allow moving and renaming?

  10. #10
    Registered User
    Join Date
    03-16-2020
    Location
    Perth
    MS-Off Ver
    365
    Posts
    78

    Re: Disable copy of worksheets and renaming of certain sheets

    OK So I have a macro that allows you to rename a sheet with prompts.

    However I have 4 specific sheets ("Summary", "Material List", "Material Summary", "Template"), that I would like to be exempt from this code with a pop up message that says: "This sheet cannot be renamed"

    Also check if the new sheet name is already in use, with a pop up message that says: "Sheet name already in use"

    Also still need something that will allow me to unlock the workbook and move sheets with the exception of the 4 specific sheets.


    Please Login or Register  to view this content.
    Last edited by Lazarus Rises; 04-25-2021 at 06:16 PM.

  11. #11
    Registered User
    Join Date
    03-16-2020
    Location
    Perth
    MS-Off Ver
    365
    Posts
    78

    Re: Disable copy of worksheets and renaming of certain sheets

    Sorting my own problems..


    The other way I thought of with renaming sheets is to just have the macro available to any sheet, except the 4 specific sheets listed earlier.

    Still need a macro that will allow the moving of sheets.

    Please Login or Register  to view this content.

+ 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. Replies: 5
    Last Post: 12-18-2014, 04:20 PM
  2. Disable renaming of worksheet.
    By muralidaran in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 05-16-2014, 09:39 AM
  3. Copy only the 1st sheet of Excel and disable copying the rest of the sheets
    By maxfusion in forum Excel Programming / VBA / Macros
    Replies: 9
    Last Post: 03-14-2014, 06:02 AM
  4. Data copy and paste to multiple sheets by renaming the names
    By Ignesh in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 11-22-2012, 02:37 PM
  5. Replies: 0
    Last Post: 08-15-2012, 08:13 AM
  6. Enable/disable copy paste (disable part not working)
    By timtim89 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 03-08-2012, 07:23 PM
  7. How to disable copy or Move function of sheets,worksheets ?
    By vumian in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 02-23-2008, 02:03 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