Ciara,
Just a had another thought on your multiple cell range problem, try using
the following line
If Target.Address = Range("C5:D9,G9:H16,B14:D18") Then
I haven't tried this so I'm not sure if it will work or not, but it's
probably worth a go (Obviously you will need to change the cell references to
those in your sheet)
"Ciara" wrote:
ok - I've got a command button that when pressed will ask for a password and
on getting the correct password enters a validation statement into a cell.
I also have some code so that if a certain cell is changed the statement is
removed - is it easy enough to have this happen when various cells are
changed?
only problem is any user can go into the validation part and just type the
statement in. so I would need to lock the cell - open it to put the
statement in - and then lock it again?
Private Sub CommandButton1_Click()
Dim strAnswer As String, MyPassword As String
MyPassword = "Test"
strAnswer = InputBox("Enter Password: ", _
"Password Protected Worksheet...")
If UCase(strAnswer) < UCase(MyPassword) Then
MsgBox ("Incorrect Password")
Else
Range("E4") = "Validated by.."
' Application.Sheets("Sheet1").Activate
End If
End Sub
Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Address = "$C$10" Then
' this need to be more than one cell - can i put multiple cells here?
Worksheets("Sheet3").Range("E4").Clear
End If
End Sub
is this the best way to do this - or am i making it more complicated?
"Neil" wrote:
I think you need to think about how strong you want to make the protected
part of the sheet.
One solution would be to have an area of your sheet set aside for a short
acceptance statement by your boss, but is by default left blank.
Then have a non-printed command button button on the sheet that when clicked
ran some VBA which asked you for a password, and then assuming the password
was correct automatically entered the acceptance statement on the sheet.
You would probably need to add some VBA code into the Change Worksheet event
that checked for changes to your key cells, and removed the acceptance
statement.
On a legal(ish) note, you might also want o add something to your sheet tat
say something about the acceptance being electronically generated, and a
written signature not being necessary. I wrote an application for a client
recently doing something similar, and it was acceptabvle as an ISO 9000
approved system.
If you need more detailed help, then please re-post, but hopefully this
will be enough to get you started.
Neil
www.nwarwick.co.uk
"Ciara" wrote:
hello.
I am working on a quote tool in excel. people go into the spread sheet -
make their selections and it will come up with a final cost.
at this stage my boss has to validate the quote. I need there to be some
part of the sheet that only he can access and maybe tick a box to say he has
validated the quote.
once he has done this if anybody changes anything in the spreadsheet it
should loose his validation.
any help is appreciated!