• Hi All

    Please note that at the Chandoo.org Forums there is Zero Tolerance to Spam

    Post Spam and you Will Be Deleted as a User

    Hui...

  • When starting a new post, to receive a quicker and more targeted answer, Please include a sample file in the initial post.

Remove data validation on cell with password

I have a spreadsheet which has data validation in certain cells. I have a button to unlock the form for modification. Is it possible to have the password remove the data validation from a certain cell. And have it put back after.
 
It is possible but only in conjuction with using a macro. I have attached sample file so you can look at the code.
 

Attachments

  • Validator Macros.xlsm
    18.1 KB · Views: 1
Last edited:
Hi. Thank you very much for your answer. I currently have a button which unlocks the form, is it possible to add this code onto the current button. I need the validation on A4 to be >0 and <72. And have it remove when the button is presses. Put back when the form is locked.
 

Attachments

  • Warranty date.xlsm
    24.7 KB · Views: 0
Hi Lesley ,

I suggest that an easier way would be to leave the Data Validation intact , and use a named range called BypassDV. This will be a Boolean variable , which can be either TRUE or FALSE.

The Data Validation rule can be written to incorporate this in its logic , and the VBA code merely puts this to TRUE or FALSE depending on whether the button is pressed or the form is locked.

Narayan
 
Back
Top