Can a Macro on exel be set with a password? in Excel Worksheet Functions  
 |  Edit my Profile  |  Help
 
     
  
 
 
 
Dave 10/1/2007 5:20 AM PST
  Question
  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
 
  Was this post helpful to you?  
 
 
  Reply | Print post   TopTop  
 
 
 
 
Sasa Stankovic 10/1/2007 10:08 AM PST
   
  if you need to protect worksheet try next:
activate sheet -> Format->Sheet->Hide
Tools->Protection->Protect Worksheet

"Dave" <Dave@discussions.microsoft.com> wrote in message
news:9C14D791-85E3-48F4-B215-2916F8185401@microsoft.com...
>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


 
  Was this post helpful to you?  
 
 
  Reply | Print post   TopTop  
 
 
 
 
Gord Dibben 10/1/2007 1:14 PM PST
  Answer
  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" <sasstank@inet.hr> wrote:

>if you need to protect worksheet try next:
>activate sheet -> Format->Sheet->Hide
>Tools->Protection->Protect Worksheet
>
>"Dave" <Dave@discussions.microsoft.com> wrote in message
>news:9C14D791-85E3-48F4-B215-2916F8185401@microsoft.com...
>>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
>

 
  Was this post helpful to you?  
 
 
  Reply | Print post   TopTop  
 
 
  Return to Microsoft Communities  Notify me of replies