+ Reply to Thread
Results 1 to 5 of 5

How to prevent users from deleting tabs

  1. #1
    Registered User
    Join Date
    08-17-2006
    Posts
    19

    How to prevent users from deleting tabs

    I have a template full of vlookup references which makes the file size huge. In order to reduce the file size; I have a macro set to run an integrity check and if there are no errors it copies and pastes - special all of the cells to reduce the depency on my vlookup tables. The macro then deletes the vlookup tables.

    The problem is that there are 3 tabs full of these vlookup references and if the user deletes one of the tabs themselves; my macro fails because it tries to do operations on a tab that isn't there.

    I can solve this one of two ways but don't know the VB code.

    1. Prevent the user from being able to delete the tabs.
    2. Add a step in the macro to only perform the operations on those tabs if the tab is present.

    Anyone have some input on this? Any feedback is appreciated because I didn't have any luck with the search function.

  2. #2
    Forum Contributor stevebriz's Avatar
    Join Date
    09-07-2006
    Location
    Santiago Chile
    Posts
    389
    One idea is to make the tabs very hidden then they can;t delete them
    VBA - The Power Behind the Grid

    Posting a sample of your workbook makes it easier to look at the Issue.

  3. #3
    Forum Contributor colofnature's Avatar
    Join Date
    05-11-2006
    Location
    -
    MS-Off Ver
    -
    Posts
    301
    You can check if a sheet exists in a workbook like this:

    Please Login or Register  to view this content.

    HTH
    Col
    If you give someone a program, you will frustrate them for a day; if you teach them how to program, you will frustrate them for a lifetime.

  4. #4
    Registered User
    Join Date
    08-17-2006
    Posts
    19
    Thank you both,

    I think the verification to see if the sheet exists will do the trick.

    Thanks!!

  5. #5
    Registered User Chappo's Avatar
    Join Date
    09-04-2006
    Posts
    33

    easy

    Stick this in VBA ThisWorkbook

    Private Sub Workbook_Open()
    ThisWorkbook.Protect "password", True, False
    End Sub

    That should stop anyone deleting tabs
    "There has never been reported stomach aches or related medical trauma that takes place after swallowing your pride.
    "
    - Daisuke Aramaki

+ 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