Hey, had no luck with this after trying various things.
I have a form where once you open my workbook it asks you to select a user and then enter a password.
It then checks the password against some data in a sheet using a V lookup.
The table basically is small and looks like so:
Administrator - admin
User1 - password
user2 - password
Just 2 columns 3 rows
The code that deals with the user form is as follows:
This part checks the usernames and passwords:Code:Private Sub EnterPassword_Click() Dim password As String password = PasswordInput.Text If password = WorksheetFunction.VLookup(UserList.Value, Range("Users_List"), 2, 0) Then Sheets("Protected").Visible = False Sheets("Blank").Visible = False MsgBox "Password Accepted" Unload Me Else Sheets("Protected").Visible = xlVeryHidden Sheets("Blank").Visible = xlVeryHidden MsgBox "Password Not Accepted, Workbook will close" Unload Me ThisWorkbook.Close End If End Sub
what I want to do is with the 'Administrator' make it a power user of sorts, and when that user is selected the sheets become visible, like this sort of:Code:If password = WorksheetFunction.VLookup(UserList.Value, Range("Users_List"), 2, 0) Then Sheets("Protected").Visible = False Sheets("Blank").Visible = False MsgBox "Password Accepted" Unload Me
But I cant integrate it into the code although I did try:Code:Sub UnhideSheets() Dim ws As Worksheet For Each ws In Worksheets ws.Visible = True Next End Sub
If anyone knows a way I can do it, I'd greatly appreciate it, this is the last part of my programCode:If UserList.Value = "Administrator" & password = "admin" Then UnhideSheets End If Unload Me
Thanks for looking
Kris
Good afternoon dntel123
I have a template available that does just what you are requiring. It can handle an unlimited amount of users (well, just over 65,500 actually) and gives the administrator total control. You just integrate my workbook into yours and away you go - it was designed to be integrated into others peoples' projects and come with full instructions and the code is unprotected so you can see how it works.
If you would like to use this, PM me your e-mail address.
HTH
DominicB
Now available : Ultimate Add-In 2007
Integrates directly into the Office Excel Ribbon
Download Ultimate Add-In v1.52 from www.dom-and-lis.co.uk
90+ Utilities, 200+ Sub utilities last updated 25th April 2008
Free!!
Hi DominicB,
I would like to see a copy of your workbook - would you be willing to post it? Thanks,
Now available : Ultimate Add-In 2007
Integrates directly into the Office Excel Ribbon
Download Ultimate Add-In v1.52 from www.dom-and-lis.co.uk
90+ Utilities, 200+ Sub utilities last updated 25th April 2008
Free!!
Your login form sounds exactly what I've been looking for. Would you be able to email me a copy?
Thank you
See this
PASSWORD FORM4.zip
Hope that helps.
RoyUK
--------
If you are pleased with a member's answer then use the Star icon to rate it, if you are pleased enough to part with cash consider a donation to Children in Need
For Excel consulting, free examples and tutorials visit Excel Consulting-Excel VBA
Check out the free Excel Toolbar
New members please read & follow the Forum Rules
Remember to mark your questions Solved and rate the answer(s)
Code Tags: Make your code easier for us to read
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks