ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Worksheet Functions (https://www.excelbanter.com/excel-worksheet-functions/)
-   -   Can a Macro on exel be set with a password? (https://www.excelbanter.com/excel-worksheet-functions/160291-can-macro-exel-set-password.html)

Dave

Can a Macro on exel be set with a password?
 
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

Sasa Stankovic

Can a Macro on exel be set with a password?
 
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




Gord Dibben

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





All times are GMT +1. The time now is 04:05 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com