Password a Macro so certain users can press it

B

Brian.Hastings82

I have a cell on my worksheet which is protected via the usual password
protect worsheet thing. However, i want to allow one person to write in
this cell my pressing a macro which allows him to do this, then lock
again after if possible? Anyone any ideas?
 
G

Guest

This may help......

Sub EnterValueInProtectedCell()
Range("A1").Select
ActiveSheet.Unprotect Password:=("aaa")
Dim k
k = InputBox("Enter new value for cell A1:")
Range("a1").Value = k
ActiveSheet.Protect Password:=("aaa"), DrawingObjects:=True, Contents:=True,
Scenarios:=True
Range("A1").Select
End Sub


Vaya con Dios,
Chuck, CABGx3
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top