Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 18
Default Code to show/hide sheet to asterisk the password

Hello all

I need some help with some code. I found the follwoing code on the web and
thank you to the author it works well, but there is a problem in that it
shows the password as you type it in, increasing the risk of people breaking
the code. Is there a way that the input in the password box can be asterisk
out and not shown as the user is typing it in

Const pWord = "password"

Sub HideSheets()
'Set worksheet to Very Hidden so that it can only be unhidden by a macro
Worksheets("Salary").Visible = xlSheetVeryHidden
End Sub

Sub ShowSheets()

'Prompt the user for a password and unhide the worksheet if correct
Select Case InputBox("Please enter the password to unhide the sheet", _
"Enter Password")

Case Is = pWord
With Worksheets("Salary")
.Visible = xlSheetVisible
.Activate
.Range("A1").Select
End With
Case Else
MsgBox "Sorry, that password is incorrect!", _
vbCritical + vbOKOnly, "You are not authorized!"
End Select
End Sub

Thanks

Regards

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 15
Default Code to show/hide sheet to asterisk the password

Hi Emanouel,

Use a form with a textbox and set the textbox property PasswordChar to *
This cannot be achieved with an inputbox.

Regards
Jean-Yves


"Newman Emanouel" wrote in message
...
Hello all

I need some help with some code. I found the follwoing code on the web and
thank you to the author it works well, but there is a problem in that it
shows the password as you type it in, increasing the risk of people
breaking
the code. Is there a way that the input in the password box can be
asterisk
out and not shown as the user is typing it in

Const pWord = "password"

Sub HideSheets()
'Set worksheet to Very Hidden so that it can only be unhidden by a
macro
Worksheets("Salary").Visible = xlSheetVeryHidden
End Sub

Sub ShowSheets()

'Prompt the user for a password and unhide the worksheet if correct
Select Case InputBox("Please enter the password to unhide the sheet", _
"Enter Password")

Case Is = pWord
With Worksheets("Salary")
.Visible = xlSheetVisible
.Activate
.Range("A1").Select
End With
Case Else
MsgBox "Sorry, that password is incorrect!", _
vbCritical + vbOKOnly, "You are not authorized!"
End Select
End Sub

Thanks

Regards



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,501
Default Code to show/hide sheet to asterisk the password

Hi,

Actually it can be done with a standard input box. Have a look at the code
here courtesy of Ivan Moala

http://www.xcelfiles.com/InPutBoxPwd.htm

Mike

"Jean-Yves TFELT" wrote:

Hi Emanouel,

Use a form with a textbox and set the textbox property PasswordChar to *
This cannot be achieved with an inputbox.

Regards
Jean-Yves


"Newman Emanouel" wrote in message
...
Hello all

I need some help with some code. I found the follwoing code on the web and
thank you to the author it works well, but there is a problem in that it
shows the password as you type it in, increasing the risk of people
breaking
the code. Is there a way that the input in the password box can be
asterisk
out and not shown as the user is typing it in

Const pWord = "password"

Sub HideSheets()
'Set worksheet to Very Hidden so that it can only be unhidden by a
macro
Worksheets("Salary").Visible = xlSheetVeryHidden
End Sub

Sub ShowSheets()

'Prompt the user for a password and unhide the worksheet if correct
Select Case InputBox("Please enter the password to unhide the sheet", _
"Enter Password")

Case Is = pWord
With Worksheets("Salary")
.Visible = xlSheetVisible
.Activate
.Range("A1").Select
End With
Case Else
MsgBox "Sorry, that password is incorrect!", _
vbCritical + vbOKOnly, "You are not authorized!"
End Select
End Sub

Thanks

Regards




  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 15
Default Code to show/hide sheet to asterisk the password

Hi Mike,

Nice Api call ! IMHO a bit complicated for novice when a textbox already
has this property.
Kind Regards
Jean-Yves

"Mike H" wrote in message
...
Hi,

Actually it can be done with a standard input box. Have a look at the code
here courtesy of Ivan Moala

http://www.xcelfiles.com/InPutBoxPwd.htm

Mike

"Jean-Yves TFELT" wrote:

Hi Emanouel,

Use a form with a textbox and set the textbox property PasswordChar to *
This cannot be achieved with an inputbox.

Regards
Jean-Yves


"Newman Emanouel" wrote in message
...
Hello all

I need some help with some code. I found the follwoing code on the web
and
thank you to the author it works well, but there is a problem in that
it
shows the password as you type it in, increasing the risk of people
breaking
the code. Is there a way that the input in the password box can be
asterisk
out and not shown as the user is typing it in

Const pWord = "password"

Sub HideSheets()
'Set worksheet to Very Hidden so that it can only be unhidden by a
macro
Worksheets("Salary").Visible = xlSheetVeryHidden
End Sub

Sub ShowSheets()

'Prompt the user for a password and unhide the worksheet if correct
Select Case InputBox("Please enter the password to unhide the
sheet", _
"Enter Password")

Case Is = pWord
With Worksheets("Salary")
.Visible = xlSheetVisible
.Activate
.Range("A1").Select
End With
Case Else
MsgBox "Sorry, that password is incorrect!", _
vbCritical + vbOKOnly, "You are not authorized!"
End Select
End Sub

Thanks

Regards






Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
how do i put an asterisk on a bar chart to show significance L Charts and Charting in Excel 3 April 2nd 23 07:04 PM
How Do I Password Hide a Sheet Gert-Jan[_2_] Excel Programming 2 December 30th 06 05:42 PM
How Do I Password Hide a Sheet Gord Dibben Excel Programming 0 December 21st 06 11:59 PM
automatically hide row if cell contains asterisk djarcadian Excel Discussion (Misc queries) 9 March 22nd 06 06:29 PM
Show/hide cells code Scottmk[_16_] Excel Programming 2 August 13th 04 12:02 AM


All times are GMT +1. The time now is 01:09 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"