Showing *** rather then characters when entering password

stroffso

Board Regular
Joined
Jul 12, 2016
Messages
160
Office Version
  1. 365
Platform
  1. Windows
Hi All,

I use some code which I found here to unhide and unhide tabs which also requires a password, however I was wondering is there any way that when I enter the password it just shows up as ********** as it would in normal scenarios where you have a password as the below allows the letters to be shown and people can easily see me entering it thus defeating the purpose of the password in the first place. TIA

Sub UnhideAllSheets()
Dim ws As Worksheet
Dim sht As Object
Dim myPassword As String


myPassword = "Stroff2018" ' Set password here


Password = InputBox("Enter Password")
Application.ScreenUpdating = False
If Password = "" Then Exit Sub ' Exit if null input or cancel


' Incorrect password
If Password <> myPassword Then
MsgBox Title:="Warning", prompt:="Incorrect Password"
Exit Sub
End If

For Each ws In ActiveWorkbook.Worksheets
ws.Visible = xlSheetVisible
Next ws
Sheets("Data").Select
'Worksheets("Lists").Visible = xlSheetVeryHidden
Application.ScreenUpdating = True
End Sub
 

Excel Facts

Excel motto
Not everything I do at work revolves around Excel. Only the fun parts.
Hi,
there has been method published in past to mask the characters of an inputbox but is quite complex when compared to setting up a userform to perform this task.

Consider updating your code to work with a userform and set the PasswordChar property to required character normally "*"

Dave
 
Last edited:
Upvote 0
I agree with @dmt32

The simplest way is to use a USERFORM containing a TEXTBOX with PasswordChar property set to *


 
Upvote 0

Forum statistics

Threads
1,223,228
Messages
6,170,876
Members
452,363
Latest member
merico17

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top