+ Reply to Thread
Results 1 to 14 of 14

Protect cells from being changed, and allowing users to delete rows.

  1. #1
    Registered User
    Join Date
    02-01-2022
    Location
    London
    MS-Off Ver
    Newest
    Posts
    22

    Protect cells from being changed, and allowing users to delete rows.

    Hi,

    Hoping someone can help.

    In my spreadsheet I’d like to protect column D from being changed, and columns G & M to have the formulas hidden.

    I have a macro to create a dashboard, and a macro to highlight the row.

    I need the end users to be able to delete rows so they only send the relevant data to managers.

    Is there any way of doing this.

    Thank you
    Attached Files Attached Files

  2. #2
    Forum Expert Keebellah's Avatar
    Join Date
    01-12-2014
    Location
    The Netherlands
    MS-Off Ver
    Office 2021 (Windows)
    Posts
    7,937

    Re: Protect cells from being changed, and allowing users to delete rows.

    Hi, may I ask why you unprotect and protect the worksheet with every selection change?
    What's the use of that?
    I don't understand the deleting rows part and to leave only relevant data on the sheet?
    Sounds quite inconsistent to me.
    The adding or deleteing rows can be achieved uisng right mouse click but then I don't understand you
    ---
    Hans
    "IT" Always crosses your path!
    May the (vba) code be with you... if it isn't; start debugging!
    If you like my answer, Click the * below to say thank-you

  3. #3
    Administrator 6StringJazzer's Avatar
    Join Date
    01-27-2010
    Location
    Tysons Corner, VA, USA
    MS-Off Ver
    MS 365 Family 64-bit 2505
    Posts
    27,281

    Re: Protect cells from being changed, and allowing users to delete rows.

    The user cannot delete a row if a cell in that row is Locked, even if you allow Delete Row when you protect the sheet.

    You will have to provide a button, or double-click, or right-click, or other mechanism for the user to delete the selected row and do it in the code. The attached example adds a button.
    Attached Files Attached Files
    Jeff
    | | |·| |·| |·| |·| | |:| | |·| |·|
    Read the rules
    Use code tags to [code]enclose your code![/code]

  4. #4
    Forum Expert
    Join Date
    02-14-2009
    Location
    .
    MS-Off Ver
    ................
    Posts
    2,840

    Re: Protect cells from being changed, and allowing users to delete rows.

    ^^^ - Getting slow in old age but also has a button added... Just tacked in at the top of the sheet so no prizes for UI design here... but an alternative might provide some ideas.

    Also introduces the UserInteraceOnly option for protection, the OP might like to read up on that.
    Attached Files Attached Files
    Last edited by cytop; 05-04-2022 at 10:09 AM.

  5. #5
    Registered User
    Join Date
    02-01-2022
    Location
    London
    MS-Off Ver
    Newest
    Posts
    22

    Re: Protect cells from being changed, and allowing users to delete rows.

    Hi,

    That works perfectly. Thank you.

    Would you be able to walk me through adding the button and getting it working.

  6. #6
    Administrator 6StringJazzer's Avatar
    Join Date
    01-27-2010
    Location
    Tysons Corner, VA, USA
    MS-Off Ver
    MS 365 Family 64-bit 2505
    Posts
    27,281

    Re: Protect cells from being changed, and allowing users to delete rows.

    Who are you asking? There were two solutions posted.

    In my case, it's all done in your file. Not sure what you want me to walk through.

  7. #7
    Registered User
    Join Date
    02-01-2022
    Location
    London
    MS-Off Ver
    Newest
    Posts
    22

    Re: Protect cells from being changed, and allowing users to delete rows.

    Hi, I was asking you 6StringJazzer. The solution works great, however i have to apply it to a work file, and I’m finding it hard to piece together being an excel beginner. I can amend the macro fine, its the button that’s the issue.

  8. #8
    Administrator 6StringJazzer's Avatar
    Join Date
    01-27-2010
    Location
    Tysons Corner, VA, USA
    MS-Off Ver
    MS 365 Family 64-bit 2505
    Posts
    27,281

    Re: Protect cells from being changed, and allowing users to delete rows.

    Go to the Developer tab.
    Under Controls panel click Insert, and in the bottom half (under ActiveX) select the Button icon, and then drag out a button on your worksheet.
    Right-click on the button and select Properties to rename the button and update the caption
    double click on the button to create the Sub for handling the Click event. You can use the code I provided for that.
    Attached Images Attached Images

  9. #9
    Forum Expert Keebellah's Avatar
    Join Date
    01-12-2014
    Location
    The Netherlands
    MS-Off Ver
    Office 2021 (Windows)
    Posts
    7,937

    Re: Protect cells from being changed, and allowing users to delete rows.

    I just played around with the file and code.
    The range is now a Listobject (table) when you right-click you can either delete the selected row or add a new row and you are prompted to enter a new ID (no check if its already present)
    Was just for fun
    Attached Files Attached Files

  10. #10
    Registered User
    Join Date
    02-01-2022
    Location
    London
    MS-Off Ver
    Newest
    Posts
    22

    Re: Protect cells from being changed, and allowing users to delete rows.

    Hi, i have a pop up, ddmsetup.tmp. Just wondering how to get rid of it and if it came from here, as these are the only files ive downloaded?

  11. #11
    Forum Expert Keebellah's Avatar
    Join Date
    01-12-2014
    Location
    The Netherlands
    MS-Off Ver
    Office 2021 (Windows)
    Posts
    7,937

    Re: Protect cells from being changed, and allowing users to delete rows.

    Delete it in the code or wherever you placed it
    Else a more extended explanation or the attach the file with non-private data

  12. #12
    Registered User
    Join Date
    02-01-2022
    Location
    London
    MS-Off Ver
    Newest
    Posts
    22

    Re: Protect cells from being changed, and allowing users to delete rows.

    The files are already attached. I’m wondering if its one of the files that I’ve downloaded from this thread. I havent downloaded anything else.

  13. #13
    Forum Expert
    Join Date
    02-14-2009
    Location
    .
    MS-Off Ver
    ................
    Posts
    2,840

    Re: Protect cells from being changed, and allowing users to delete rows.

    That looks more like an AV warning than anything else. If you're running on a Dell then Dell have a DDMSetup.exe (Dell Display Monitor) and setup programs sometimes create TMP files which will be scanned by your Anti-Virus.

    In any case, more information would be needed before anyone can comment for certain. Does the popup have a caption at the top of the window? Any message displayed? Any available buttons/options?
    Last edited by cytop; 05-09-2022 at 08:23 AM.

  14. #14
    Forum Expert Keebellah's Avatar
    Join Date
    01-12-2014
    Location
    The Netherlands
    MS-Off Ver
    Office 2021 (Windows)
    Posts
    7,937

    Re: Protect cells from being changed, and allowing users to delete rows.

    Nothing to do with the Excel file

+ 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. [SOLVED] How to protect column formula AND let users delete rows?
    By xdrenched in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 03-24-2016, 05:25 PM
  2. Locking a sum formula while still allowing users to insert and delete rows
    By ksmith21 in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 03-12-2015, 08:21 AM
  3. Replies: 1
    Last Post: 11-21-2013, 02:51 PM
  4. [SOLVED] How do you protect multiple worksheets at the same time while only allowing users to selec
    By mrssteelerhall in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 03-15-2013, 02:13 PM
  5. [SOLVED] How do you protect multiple sheets while only allowing users to select unlocked cells?
    By mrssteelerhall in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 03-15-2013, 02:05 PM
  6. Protect Sheet Allowing Users to Format Rows/Edit Objects?
    By Kristine T. in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 11-16-2009, 04:38 PM
  7. How can I protect cells and allow users to insert/delete
    By Jammy Dodger in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 01-12-2006, 06:20 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