Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
Jim Jim is offline
external usenet poster
 
Posts: 615
Default Require Password to overide data validation

I would like to require a password for a user to overide data validation in a
cell.

For example

Cell A5 shows a maximum loan value of $40,000. The user is to enter the
actual loan amount in A6, which I have a data validation of not to exceed A5.
I would like to have the data validation reject any value of A5 unless the
user can enter a password.

Is this possible?
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,049
Default Require Password to overide data validation

use the sheet's change event ... I added another sheet, named it
'passwords' and made it xlVeryHidden. I put a password in A1

in you sheet with cell A6 to be checked, leave the datavalidation to handle
the amount. go to the sheet's code page (right-click the tab and choose View
Code) and paste in this:


Option Explicit
Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Address = Range("A6").Address Then
If Not PasswordOK Then
Application.EnableEvents = False
Target = Range("A1")
Application.EnableEvents = True
End If
End If
End SubFunction PasswordOK() As Boolean
Dim pwd As String
pwd = InputBox("Please enter your password")
If pwd = Worksheets("passwords").Range("A1").Value Then
PasswordOK = True
End If
End Function

just one idea. another would be to check the username from the pc

"Jim" wrote in message
...
I would like to require a password for a user to overide data validation
in a
cell.

For example

Cell A5 shows a maximum loan value of $40,000. The user is to enter the
actual loan amount in A6, which I have a data validation of not to exceed
A5.
I would like to have the data validation reject any value of A5 unless the
user can enter a password.

Is this possible?


Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Data Validation- Require Entry in a Field KrispyData Excel Discussion (Misc queries) 1 May 22nd 09 05:34 AM
Require a password to execute a macro Rjeffay Excel Programming 3 April 21st 06 06:38 PM
Require certain password for sheet1 to save mikeburg[_61_] Excel Programming 0 January 14th 06 04:06 AM
Require password to execute macro richinlaf31[_4_] Excel Programming 0 August 3rd 05 07:13 PM
require password each time a macro is executed Marty Excel Programming 6 October 10th 04 08:13 PM


All times are GMT +1. The time now is 12:50 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"