Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default How to hide password?


Option Explicit

Private Sub AddNameButton_Click()
'This allows users to add their name to the list of users
Dim strName As String
Dim strPassword As String
Dim Counter As Integer
Dim Check As Boolean
Me.Hide
'Display input box to captrue name and password
strName = InputBox(Prompt:="Please Enter Your Name.", _
Title:="ENTER YOUR NAME", Default:="Your Name Here")
strPassword = InputBox(Prompt:="Please enter your password.", _
Title:="ENTER YOUR Password", Default:="Your Password Here")

'If it doesn't have anything, then exit sub
If strName = "Your Name here" Or strName = vbNullString Or strPassword = "Your Password Here" Or strPassword = vbNullString Then
MsgBox ("Error, please try again")
Exit Sub

Else
'make the password lowercase - for some reason case does matter in this report
strPassword = StrConv(strPassword, vbLowerCase)
Me.Hide
Counter = 1
Check = False
Do Until Check = True
If Sheets("Data Sheet").Range("Table1[[#Headers],[Names]]").Offset(Counter, 0) = "" Then
Check = True
'Format cells as text, otherwise you could get errors
Worksheets("Data Sheet").Range("Table1[[#Headers],[Names]]").Offset(Counter, 0).NumberFormat = "@"
Worksheets("Data Sheet").Range("Table1[[#Headers],[Names]]").Offset(Counter, 0) = strName
Worksheets("Data Sheet").Range("Table1[[#Headers],[Names]]").Offset(Counter, 1).NumberFormat = "@"
Worksheets("Data Sheet").Range("Table1[[#Headers],[Names]]").Offset(Counter, 1) = strPassword
'Sort list alphabetically, to help people find their name
Worksheets("Data Sheet").ListObjects("Table1").Sort.SortFields.Clea r
Worksheets("Data Sheet").ListObjects("Table1").Sort.SortFields.Add _
Key:=Range("Table1[[#All],[Names]]"), SortOn:=xlSortOnValues, Order:= _
xlAscending, DataOption:=xlSortTextAsNumbers
ActiveWorkbook.Worksheets("Data Sheet").ListObjects("Table1").Sort.Apply
ActiveWorkbook.Save
Else
If Sheets("Data Sheet").Range("Table1[[#Headers],[Names]]").Offset(Counter, 0) = strName Then
MsgBox ("Error - Your Name Is Already Enterer. Please Check Again.")
Exit Sub
End If
End If
Counter = Counter + 1
Loop
End If
Unload Me
Call ShowPunchIn
End Sub

Private Sub Label1_Click()

End Sub

Private Sub PunchIn_Click()
'This is the sub to record the time when punching in. It records the data on the "Data Sheet" Sheet
'The "Data Sheet" sheet also has the usernames and passwords of the users
Dim Counter As Double
Dim Strp As String
Dim Found As Boolean
Dim strPassword As String
Me.Hide
strPassword = PasswordTextBox.Text
strPassword = StrConv(strPassword, vbLowerCase)
'Find their Username on the List
Counter = 0
Found = False
Do Until Found = True
Counter = Counter + 1
If Sheets("Data Sheet").Range("Table1[[#Headers],[Names]]").Offset(Counter, 0) = NameDropDown.Text Then
Found = True
End If
'Error if the name is not on the list
If Sheets("Data Sheet").Range("Table1[[#Headers],[Names]]").Offset(Counter, 0) = "" Then
MsgBox ("Name is not in list. Please Select a name from the dropdown menu or add your name to the list.")
Unload Me
Call ShowPunchIn
Exit Sub
End If
Loop
'Check to see if password matches
If Sheets("Data Sheet").Range("Table1[[#Headers],[Names]]").Offset(Counter, 1) = strPassword Then
Found = False
Counter = 1
Do Until Found = True
'Enter in the time and save
If Sheets("Data Sheet").Range("b2").Offset(Counter, 0) = "" Then
Sheets("Data Sheet").Range("b2").Offset(Counter, 0).NumberFormat = "@"
Sheets("Data Sheet").Range("b2").Offset(Counter, 0) = NameDropDown.Text
Sheets("Data Sheet").Range("b2").Offset(Counter, 1) = Now
Found = True
Strp = "Punched in at " & Now
MsgBox (Strp)
ActiveWorkbook.Save
Else
'If there is an error, then notify
If Sheets("Data Sheet").Range("b2").Offset(Counter, 0) = NameDropDown.Text Then
If Sheets("Data Sheet").Range("b2").Offset(Counter, 2) = "" Then
MsgBox ("You May Have Not Clocked Out. Please Talk to Mr.Hemachandran to Fix the Error.")
Found = True
Unload Me
Call ShowPunchIn
Exit Sub
End If
End If
End If
Counter = Counter + 1
Loop
Else: MsgBox ("Incorrect Password")
End If

Unload Me
End Sub
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 587
Default How to hide password?

hi,

InputBox doesn't have this functionality. you will need to make a userform with
a text box on it and set the PasswordChar property of the text box to something
like *

isabelle

Le 2014-11-27 01:36, Ramesh ML a écrit :
How to hide password?

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
Hide a Password ryguy7272 Excel Programming 2 May 12th 09 08:03 PM
hide column with password checkQ Excel Discussion (Misc queries) 5 February 11th 07 09:39 PM
how to hide raws and use password speedo Excel Discussion (Misc queries) 0 February 1st 06 03:34 PM
How do I hide a worksheet in Excel and use a password to un-hide . Dchung Excel Discussion (Misc queries) 3 December 2nd 04 06:24 AM
Excel password but cant hide the sheets before entering password cakonopka[_3_] Excel Programming 1 January 30th 04 06:28 PM


All times are GMT +1. The time now is 05:30 PM.

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"