How to Password protect a value with Data Validation

taeschle

New Member
Joined
Sep 1, 2021
Messages
3
Office Version
  1. 365
Platform
  1. Windows
Hello , I am working to build a PO system in Excel and I am not a programmer at all. I have googled my way through getting a data form to pop up automatically asking for po numbers , date , cost .....ext . I have added data validation to create an error if the cost of the part is over $1000. What I would like to do is be able to enter a password that grants approval to get past the data validation.

Basically i want my parts guy to need me to enter a passwords in the cost cell of the excel sheet in order to enter a value over 1$000

Is this possible.
 

Excel Facts

Enter current date or time
Ctrl+: enters current time. Ctrl+; enters current date. Use Ctrl+: Ctrl+; Enter for current date & time.
Hi, and welcome to Mr. Excel!

Pretty much anything's possible.

Rather than do the >$1,000 handling at the worksheet end (with data validation), as you're already using code, I'd be inclined to put that process into the code - after data entry, and before it's passed to the worksheet. Presumably, you're using some kind of "Enter Data" button on the userform for this?
Please post your code; you're more likely to get help here, if you post what you already have in place, along with enough detail to enable Folk to give you a solution, without having to ask for more info.
 
Upvote 0
The only code I have entered in this is

Private Sub Workbook_Open()
ActiveSheet.ShowDataForm
End Sub


All its doing is prompting a popup window for data entry
 
Upvote 0
1630516995003.png
This is my data input its opening. I would liketo require password approvalin order to enter a value of over 1000 into the cost tab
 
Upvote 0
Having originally said that "...Pretty much anything's possible" I'd not noticed you were using a dataform for the input.
I hope one of the gurus comes along, and corrects me, but AFAIK, you can't manipulate the dataform in the way you can a UserForm (which is the way I would do this).
As you've already discovered, you can use VBA code to display the dataform, but subsequent code lines are then paused all the time the form remains open. Also, the worksheet_change event is supressed, so any code which runs in response to your Cost column changes, (where you'd normally test for >$1,000, and take action if True) will also not work.

You could build your own - which emulated the built-in dataform, and would then give you full control to do whatever you liked (one such step-by-step example to do so can be found here , but it's a bit of a faff - particularly if you're a VBA novice; it would, however, give you full control, and allow you to do what you're asking.
 
Upvote 0

Forum statistics

Threads
1,214,956
Messages
6,122,465
Members
449,085
Latest member
ExcelError

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top