+ Reply to Thread
Results 1 to 10 of 10

Prevent Users From Deleting, Inserting Rows and Columns Without Protecting Worksheet

  1. #1
    Registered User
    Join Date
    06-29-2012
    Location
    New York
    MS-Off Ver
    Excel 2007
    Posts
    98

    Prevent Users From Deleting, Inserting Rows and Columns Without Protecting Worksheet

    Hello, is there a way to prevent users from Deleting and Inserting Rows/Columns without protecting the Worksheet?

    The reason I don't want to protect the worksheet is because when someone pastes something into my worksheet, it defaults it to "locked" and then they are unable to use the cell again.

    I know that there is no workaround with "Match Destination Formating as Default" with "Ctrl + V". I have been using a marco for Ctrl +D.
    Last edited by johnph; 07-19-2012 at 03:44 PM.

  2. #2
    Forum Contributor
    Join Date
    05-25-2012
    Location
    California
    MS-Off Ver
    Excel 2010
    Posts
    194

    Re: Prevent Users From Deleting, Inserting Rows and Columns Without Protecting Worksheet

    To answer your question; yes and no.

    You can actually completely modify a user's ability to edit based on their overall Excel settings. However, you will have to invoke these properties when you're workbook is active/open, and revert them back to the user's former settings when other workbooks are opened/viewed. I do not recommend changing a user's settings as any errors in your programming could cause them to lose their original settings, etc.

    You can actually edit any shortcut key as well - for example to disable ctrl+v from doing anything you can use the following:

    Note: the ^ (carrot) key represents "control" and the {v} represents the literal keyboard character v. Basically the comand sets the shortcut command to run "" (nothing);

    Please Login or Register  to view this content.

  3. #3
    Registered User
    Join Date
    06-29-2012
    Location
    New York
    MS-Off Ver
    Excel 2007
    Posts
    98

    Re: Prevent Users From Deleting, Inserting Rows and Columns Without Protecting Worksheet

    Yeah, figures. I can live with Ctrl + D for now. Is there any way to prevent them from deleting and inserting ROWS/COLUMNS?

  4. #4
    Forum Expert mikerickson's Avatar
    Join Date
    03-30-2007
    Location
    Davis CA
    MS-Off Ver
    Excel 2011
    Posts
    6,229

    Re: Prevent Users From Deleting, Inserting Rows and Columns Without Protecting Worksheet

    To prevent insertion, put "x" in Cells(Rows.Count, Columns.Count)
    _
    ...How to Cross-post politely...
    ..Wrap code by selecting the code and clicking the # or read this. Thank you.

  5. #5
    Registered User
    Join Date
    06-29-2012
    Location
    New York
    MS-Off Ver
    Excel 2007
    Posts
    98

    Re: Prevent Users From Deleting, Inserting Rows and Columns Without Protecting Worksheet

    What do you mean by putting "X" in cells(row.count, columns.count). Sorry I am a bit lost.

  6. #6
    Forum Expert mikerickson's Avatar
    Join Date
    03-30-2007
    Location
    Davis CA
    MS-Off Ver
    Excel 2011
    Posts
    6,229

    Re: Prevent Users From Deleting, Inserting Rows and Columns Without Protecting Worksheet

    If you put anything in the far right column and try to insert a column, Excel won't do it. I will not move data off the edge of the spreadhsheet. Run this code and then try to insert either an entire column or an entire row. You won't be permitted.

    Please Login or Register  to view this content.
    That will allow the user to insert individual cells, just not whole columns or whole rows.
    To forbid any insertions
    Please Login or Register  to view this content.
    Note that this doesn't effect deletions.

  7. #7
    Registered User
    Join Date
    06-29-2012
    Location
    New York
    MS-Off Ver
    Excel 2007
    Posts
    98

    Re: Prevent Users From Deleting, Inserting Rows and Columns Without Protecting Worksheet

    wow great trick haha, is there any way to prevent deletion? Thanks Mike

  8. #8
    Registered User
    Join Date
    06-29-2012
    Location
    New York
    MS-Off Ver
    Excel 2007
    Posts
    98

    Re: Prevent Users From Deleting, Inserting Rows and Columns Without Protecting Worksheet

    Maybe perhap hide the delete and insert feature with

    Please Login or Register  to view this content.
    Does excel 2007 have something like this?

  9. #9
    Registered User
    Join Date
    09-24-2014
    Location
    Essex
    MS-Off Ver
    2013
    Posts
    1

    Re: Prevent Users From Deleting, Inserting Rows and Columns Without Protecting Worksheet

    My problem is the reverse of this. I have successfully locked 4 cells in my worksheet, but the step of protecting the worksheet means I can no longer insert rows (which are unaffected by the cell locking).

    Therefore my question is:

    How do I insert rows in a protected worksheet?

  10. #10
    Forum Expert mikerickson's Avatar
    Join Date
    03-30-2007
    Location
    Davis CA
    MS-Off Ver
    Excel 2011
    Posts
    6,229

    Re: Prevent Users From Deleting, Inserting Rows and Columns Without Protecting Worksheet

    Depending on your version of Excel, the Protection dialog will include checkboxes about what is permitted on a protected sheet.

+ 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