+ Reply to Thread
Results 1 to 14 of 14

Password Protect a cell from deleting

  1. #1
    Forum Contributor
    Join Date
    08-18-2017
    Location
    india
    MS-Off Ver
    2010
    Posts
    490

    Password Protect a cell from deleting

    Hey guys,

    I am stuck with this problem.

    I need to password protect Range "A1:A3000" with a vba code.

    So if anyone tries to delete the range then they are promted to type the password then only they can delete the cell in the range.

    Is this possible?

  2. #2
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    52,929

    Re: Password Protect a cell from deleting

    You dont need VBA for that, just use regular protection, and set the file as Read Only
    1. Use code tags for VBA. [code] Your Code [/code] (or use the # button)
    2. If your question is resolved, mark it SOLVED using the thread tools
    3. Click on the star if you think someone helped you

    Regards
    Ford

  3. #3
    Banned User!
    Join Date
    02-05-2015
    Location
    San Escobar
    MS-Off Ver
    any on PC except 365
    Posts
    12,168

    Re: Password Protect a cell from deleting

    Maybe use Allow Users to Edit Ranges

  4. #4
    Forum Contributor
    Join Date
    08-18-2017
    Location
    india
    MS-Off Ver
    2010
    Posts
    490

    Re: Password Protect a cell from deleting

    I cannot make it read only because i have 3 other people who use the same file.
    They use it to make invoices.

    I just want to ensure that they do not delete the contents of the cell.
    So i want to password protect it

  5. #5
    Banned User!
    Join Date
    02-05-2015
    Location
    San Escobar
    MS-Off Ver
    any on PC except 365
    Posts
    12,168

    Cool Re: Password Protect a cell from deleting

    did you read post#3 ?

    see this one

    sheet pass: abc
    range pass: 123456
    Attached Files Attached Files

  6. #6
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    80,647

    Re: Password Protect a cell from deleting

    So if you do not want them to delete the contents of the cell, then you do not want them to edit it. What you do, simply, is mark the cells they ARE allowed to edit as unlocked, and then protect the sheet - this will stop them changing anything in cells they are not allowed to edit, but they will still be able to enter text or numbers where they need to.
    Ali


    Enthusiastic self-taught user of MS Excel who's always learning!
    Don't forget to say "thank you" in your thread to anyone who has offered you help.
    You can reward them by clicking on * Add Reputation below their user name on the left, if you wish.

    Forum Rules (updated August 2023): please read them here.

  7. #7
    Registered User
    Join Date
    08-11-2017
    Location
    Budapest
    MS-Off Ver
    2016
    Posts
    68

    Re: Password Protect a cell from deleting

    sandy666, how is that file protected? I deleted everything and saved it. All contents are gone.

  8. #8
    Banned User!
    Join Date
    02-05-2015
    Location
    San Escobar
    MS-Off Ver
    any on PC except 365
    Posts
    12,168

    Re: Password Protect a cell from deleting

    with known pass you can do everything
    if user don't know pass he can't delete or change
    btw. Excel security level is 0

  9. #9
    Registered User
    Join Date
    08-11-2017
    Location
    Budapest
    MS-Off Ver
    2016
    Posts
    68

    Re: Password Protect a cell from deleting

    But it didn't ask for a password. I don't really understand this.

  10. #10
    Banned User!
    Join Date
    02-05-2015
    Location
    San Escobar
    MS-Off Ver
    any on PC except 365
    Posts
    12,168

    Re: Password Protect a cell from deleting

    do you have something like this?

    passforrange.jpg

    if yes, unlock whole sheet, select range, lock cells, set pass for this range, then set pass for worksheet

    if not - forget it

  11. #11
    Registered User
    Join Date
    08-11-2017
    Location
    Budapest
    MS-Off Ver
    2016
    Posts
    68

    Re: Password Protect a cell from deleting

    I see. but I can delete the contents.

  12. #12
    Banned User!
    Join Date
    02-05-2015
    Location
    San Escobar
    MS-Off Ver
    any on PC except 365
    Posts
    12,168

    Re: Password Protect a cell from deleting

    maybe you doing something wrong or Ex2007 doesn't support this feature well

    but, like I said above, security level is 0 because I can remove pass in 5 secs

  13. #13
    Registered User
    Join Date
    08-11-2017
    Location
    Budapest
    MS-Off Ver
    2016
    Posts
    68

    Re: Password Protect a cell from deleting

    ok. thanks.

  14. #14
    Banned User!
    Join Date
    02-05-2015
    Location
    San Escobar
    MS-Off Ver
    any on PC except 365
    Posts
    12,168

    Re: Password Protect a cell from deleting

    You are welcome

+ 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. Password Protect One Cell?
    By zeeshan_mirza in forum Excel General
    Replies: 13
    Last Post: 09-12-2022, 07:10 AM
  2. [SOLVED] Password Protect Document Using Cell Value
    By Darth Raven in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 02-19-2014, 07:15 AM
  3. Replies: 2
    Last Post: 01-17-2013, 08:39 AM
  4. [SOLVED] Password protect as cell value
    By Dibbley247 in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 10-31-2012, 06:54 PM
  5. Password Protect a single cell
    By Dwaine Horton in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 03-17-2006, 09:30 AM
  6. [SOLVED] Password Protect a Cell w/ a Macro
    By storminspank in forum Excel General
    Replies: 6
    Last Post: 12-22-2005, 02:50 PM
  7. How to password protect a cell but still be able to sort ?
    By GW Trainer in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 04-19-2005, 06:06 PM
  8. Password protect individual cell
    By JimmyB in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 01-26-2005, 12:15 PM

Tags for this Thread

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