Im doing a spreadsheet for my A Level ICT coursework and have multiple sheets that are hidden from view unless a password is entered (all other routes to unhiding sheets are locked out). At the moment the password can only be changed if a user changes it in the Visual BASIC editor.
VB Code:
  1. Private Sub ok_Click()
  2.   If password = chngpass.key Then
  3.       Unload Me
  4.       Correct.Show
  5.       ActiveWorkbook.Unprotect
  6.       Sheets("PaySlips").Visible = True
  7.       Sheets("Shifts").Visible = True
  8.       Sheets("Shifts").Select
  9.       Application.DisplayFormulaBar = True
  10.       Application.ActiveWindow.DisplayWorkbookTabs = True
  11.   Else
  12.       Unload Me
  13.       wrong.Show
  14.   End If
  15. End Sub
As you can see, the password is stored on a different form (chngpass) I wish to use this form to enable the "admin" to change the password without the hassle of the VB editor. I have used "Nested If" statements (if thats what they are called in VB) to validate the original password and the new/repeated passwords before allowing any change, the only problem that I am unable to work around is permenantly changing the value of the text box that the password is stored in, as it just resets when it closes. Can someone help me by sending a line of code that will work around this problem if it exists?
Thanks in advance,

Craig.