locked
Removing ability to copy a tab with VBA coding RRS feed

  • Question

  • Hi,

    I work in Excel 2007. I would like to remove the possibility to copy a tab (by right click the tab). Is that possible with vba-coding and how do I do? The reason is that I got some code in a tab called "result" (which is the tab in question) and if the code gets duplicated I get an error message when I run my macros.

    Best Sverre


    Sverreberre

    Thursday, September 12, 2013 8:17 AM

Answers

  • VBA code in a worksheet module should be specific to that worksheet, so it shouldn't matter if the sheet (and hence its code) is duplicated.

    You can protect the workbook for Structure. This will disable the ability to copy, move, insert or delete sheets altoghether.


    Regards, Hans Vogelaar (http://www.eileenslounge.com)

    • Marked as answer by sverreberre Thursday, September 12, 2013 10:37 AM
    Thursday, September 12, 2013 9:47 AM

All replies

  • VBA code in a worksheet module should be specific to that worksheet, so it shouldn't matter if the sheet (and hence its code) is duplicated.

    You can protect the workbook for Structure. This will disable the ability to copy, move, insert or delete sheets altoghether.


    Regards, Hans Vogelaar (http://www.eileenslounge.com)

    • Marked as answer by sverreberre Thursday, September 12, 2013 10:37 AM
    Thursday, September 12, 2013 9:47 AM
  • Txn. Protecting workbook was exactly what I was looking for.


    Sverreberre

    Thursday, September 12, 2013 10:38 AM