Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 23
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default 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
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
Change password Anthony G of La Quinta Excel Discussion (Misc queries) 1 June 21st 05 12:58 AM
change password choice Excel Programming 2 April 22nd 04 12:27 AM
re Password Change again Libby Excel Programming 1 December 22nd 03 01:50 AM
password change again Libby Excel Programming 3 December 21st 03 11:02 PM
change password Libby Excel Programming 1 December 20th 03 09:33 PM


All times are GMT +1. The time now is 10:12 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"