Go Back   Access World Forums > Apps and Windows > Excel

 
Reply
 
Thread Tools Rate Thread Display Modes
Old 05-23-2011, 02:00 PM   #1
WolfEyes
Newly Registered User
 
Join Date: May 2011
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
WolfEyes is on a distinguished road
Password change using VBA in Excel 2003.

Hi Guys

I hope you are able to help me.

I'am using Windows 7 and Excel 2003.

A workbook we use has a Management Information sheet, the MI sheet is Password protected but I need to give the ability for those that have access to change their password themselves.

I have used a UserForm to allow those with access to the MI sheet to change their password. The Userform has 2 Text boxes and 2 Command Buttons. Text Box 1 allows the user to enter their current password, if that is correct when using the Command Button to enter the old password it takes you to a hidden frame with a further Text Box to enter the new Password and the Command Button 2 changes the Password. This interacts with a seperate spreadsheet called Pass that stores the users and their passwords.

At present it works fine but only for the first user and no one else.

The code is as follows:

Code:
Private Sub CommandButton1_Click()
If TextBox1.Value = Sheet2.Range("B2").Value Then
  Frame1.Visible = True
  Me.Height = 90
Else: Unload Me
End If
End Sub
 
Private Sub CommandButton2_Click()
Sheet2.Range("B2").Value = TextBox2.Value
 
Unload Me
 
End Sub
The passwords are stored in Column range B2:B20

Can anyone help with the code so that it changes any of the possible passwords that could be used between the range B2:B20. As I said at the moment it only works for the password in B2(the first user) I cannot for the life of me get the code to work for any of the Users that wants to change their Password except the User for B2.

I have attached a stripped down version of the workbook.

Thanks in advance.
Attached Files
File Type: xls Pass.xls (46.5 KB, 207 views)

WolfEyes is offline   Reply With Quote
Reply

Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
password protect query in Ms access 2003 as7685 Queries 2 12-16-2010 09:05 PM
Question Access 2003 Crashes when linking to Excel 2003 Colt45 General 0 09-23-2010 02:10 AM
Question Access 2003 - Regular password changes Peetee General 8 09-03-2008 07:55 AM
export a report from access 2003 to excel 2003 using the outputto method DJBummy General 0 03-08-2006 07:23 AM
2003 Password Issues??? AngelT General 1 08-19-2004 10:03 PM




All times are GMT -8. The time now is 01:06 AM.


Microsoft Access Help
General
Tables
Queries
Forms
Reports
Macros
Modules & VBA
Theory & Practice
Access FAQs
Code Repository
Sample Databases
Video Tutorials

Sponsored Links

How to advertise

Media Kit


Powered by vBulletin®
Copyright ©2000 - 2018, Jelsoft Enterprises Ltd.
(c) copyright 2017 Access World