Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Change Password from an Array
Hi,
I have devised a UserForm that asks for a username and password which in turn unlocks certain parts of a work book for that user, I want to enable them to change the password that has been assigned to them. I am currently trying to use InputBox method for this, with some degree of success where I can populate the sheet with the passwords on it, but not for each individual user. So what I think I need is a way to look up who the user is in the array then change the password for that user. |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Change Password from an Array
You said inputbox, but unless you want to show a series of inputboxes, I
would use a userform such as below Assume the username is in Textbox1 and the usernames are listed in Sheet10 starting in A1 and current corresponding passwords in column B Textbox2: Old Password Textbox3: New Password Textobx4: New Password (confirmation) Private Sub CommandButton1_Click() Dim rng as Range Dim res as Variant With worksheets("Sheet1") set rng = .Range(.Cells(1,1),Cells(1,1).End(xldown)) end with res = Application.Match(Textbox1.Value,rng,0) if not iserror(res) then if rng(res).offset(0,1).Value = Textbox2.Text then if Textbox3.Value = Textbox4.Value then rng(res).offset(0,1).Value = Textbox3.Value Activeworkbook.Save msgbox "Password Changed else msgbox "Passwords do not match" exit sub end if else msgbox "Orignal password incorrect" exit sub end if Else msgbox "Invalid user id" exit sub end if End Sub If you still want to use inputboxes, then the above should give you the basics with which you can integrate inputbox promts.. -- Regards, Tom Ogilvy "spences10" wrote in message ups.com... Hi, I have devised a UserForm that asks for a username and password which in turn unlocks certain parts of a work book for that user, I want to enable them to change the password that has been assigned to them. I am currently trying to use InputBox method for this, with some degree of success where I can populate the sheet with the passwords on it, but not for each individual user. So what I think I need is a way to look up who the user is in the array then change the password for that user. |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Change password | Excel Discussion (Misc queries) | |||
change password | Excel Programming | |||
re Password Change again | Excel Programming | |||
password change again | Excel Programming | |||
change password | Excel Programming |