View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Gord Dibben Gord Dibben is offline
external usenet poster
 
Posts: 22,906
Default Can a Macro on exel be set with a password?

Dave

What do you mean by "macro button to be password protected"?

If you don't want anyone to see the sheet, hide the sheet then protect the
workbook for windows and structure.

If you don't want anyone to run a macro from your button, password protect the
code.

Sub foo()
Dim mypword As String
mypword = InputBox("enter a password")
If mypword < "drowssap" Then
MsgBox "wrong password"
Exit Sub
Else
MsgBox "what now, brown cow"
End If
End Sub


Gord Dibben MS Excel MVP

On Mon, 1 Oct 2007 19:00:16 +0200, "Sasa Stankovic" wrote:

if you need to protect worksheet try next:
activate sheet - Format-Sheet-Hide
Tools-Protection-Protect Worksheet

"Dave" wrote in message
...
I would like a macro button to be password protected on a spread sheet that
I
have, so people can look a things on the other sheets, but not on one of
them.
Thanks

Dave