Assign Password to Button

C

Chip Pearson

It isn't clear what you mean. You can't set up a command button
such that you need a password to click it.


--
Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting, LLC
www.cpearson.com
 
N

Norman Jones

Hi Mark,

Try something like:

'=============>>
Private Sub CommandButton1_Click()
Dim res As Variant
Const PWORD As String = "ABCD" '<<==== CHANGE

res = InputBox("Insert password")

If res <> PWORD Then Exit Sub
'Your button code
End Sub
'<<=============
 
M

Mark

I have a button driven spreadsheet used on a network. I want to password
protect the button which is used for uncustomising things when I make
changes.

Basically the button runs a variation of the auto close macro without
actually closing down. When the button is pressed I want excel to ask for a
password.

Thanks,

Mark
 
Top