+ Reply to Thread
Results 1 to 11 of 11

Disable copy of worksheets and renaming of certain sheets

Hybrid View

  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"?


    Private Sub worksheet_SelectionChange(ByVal Target As Excel.Range)
    'Updateby Extendoffice
    If ActiveSheet.Name <> "Master" Then
    ActiveSheet.Name = "Master"
    End If
    End Sub

  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

    Application.EnableEvents = False
    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.


    Option Explicit
     
    Private Sub Workbook()
    
        Application.EnableEvents = False
        End With
         
    End Sub
    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.

+ 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