ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Worksheet Functions (https://www.excelbanter.com/excel-worksheet-functions/)
-   -   How do I write a macro that will allow users to set thier own pass (https://www.excelbanter.com/excel-worksheet-functions/151489-how-do-i-write-macro-will-allow-users-set-thier-own-pass.html)

David A.

How do I write a macro that will allow users to set thier own pass
 
I need to let the user chose thier own password. Of course I will need a
master password for my self to reset anyone that forgets theirs. Is there a
way to do this?

Gord Dibben

How do I write a macro that will allow users to set thier own pass
 
No such thing as a Master password that overrides individual passwords

Keep a list of the users' passwords handy so's you can assist when they forget.


Gord Dibben MS Excel MVP

On Tue, 24 Jul 2007 09:02:01 -0700, David A.
wrote:

I need to let the user chose thier own password. Of course I will need a
master password for my self to reset anyone that forgets theirs. Is there a
way to do this?



David A.

How do I write a macro that will allow users to set thier own
 
How do I set up multible log ins and passwrods for this workbook?

"Gord Dibben" wrote:

No such thing as a Master password that overrides individual passwords

Keep a list of the users' passwords handy so's you can assist when they forget.


Gord Dibben MS Excel MVP

On Tue, 24 Jul 2007 09:02:01 -0700, David A.
wrote:

I need to let the user chose thier own password. Of course I will need a
master password for my self to reset anyone that forgets theirs. Is there a
way to do this?




Gord Dibben

How do I write a macro that will allow users to set thier own
 
The question "why do you need multiple passwords to open the workbook?" comes to
mind if users are opening just the single workbook.

Back to the question "How do I set up multiple log ins and passwords for this
workbook?"

You could have them first open a dummy workbook with select case code to trap
their login name and ask for a password that matches that name.

If correct password entered, the workbook would open.

There may be another method depending upon why you want this.

Do you want to deny access to some users?

Do you want the workbook to open with just certain sheets visible depending upon
which user opens the workbook?


Gord

On Tue, 24 Jul 2007 09:54:02 -0700, David A.
wrote:
How do I set up multible log ins and passwrods for this workbook?


"Gord Dibben" wrote:

No such thing as a Master password that overrides individual passwords

Keep a list of the users' passwords handy so's you can assist when they forget.


Gord Dibben MS Excel MVP

On Tue, 24 Jul 2007 09:02:01 -0700, David A.
wrote:

I need to let the user chose thier own password. Of course I will need a
master password for my self to reset anyone that forgets theirs. Is there a
way to do this?





David A.

How do I write a macro that will allow users to set thier own
 
I managers that have teams. I use a workbook to track any errors that a
managers team memeber makes. I need to open just those that are assigned to
a particular manager. I don't want managers looking at other managers errors.
So if I set it up so that they creat a log in ( or I assign one) and
password it would accommplish my task.

"Gord Dibben" wrote:

The question "why do you need multiple passwords to open the workbook?" comes to
mind if users are opening just the single workbook.

Back to the question "How do I set up multiple log ins and passwords for this
workbook?"

You could have them first open a dummy workbook with select case code to trap
their login name and ask for a password that matches that name.

If correct password entered, the workbook would open.

There may be another method depending upon why you want this.

Do you want to deny access to some users?

Do you want the workbook to open with just certain sheets visible depending upon
which user opens the workbook?


Gord

On Tue, 24 Jul 2007 09:54:02 -0700, David A.
wrote:
How do I set up multible log ins and passwrods for this workbook?


"Gord Dibben" wrote:

No such thing as a Master password that overrides individual passwords

Keep a list of the users' passwords handy so's you can assist when they forget.


Gord Dibben MS Excel MVP

On Tue, 24 Jul 2007 09:02:01 -0700, David A.
wrote:

I need to let the user chose thier own password. Of course I will need a
master password for my self to reset anyone that forgets theirs. Is there a
way to do this?





Gord Dibben

How do I write a macro that will allow users to set thier own
 
Note: the following is contingent upon users enabling macros.

If they don't only the "Dummy" sheet will be visible.

I assume you are on a network(LAN) with users logging into the system.

I would set it up so that whichever user's login name is flagged, all sheets
except that user would be hidden.

No password to open the workbook, just code to make a user's sheet visible.

In the Thisworkbook Module....................

Private Sub Workbook_Open()
Dim pword As String
Select Case Environ("Username")
'if a login is not used change to
'pword = InputBox("Enter Your Password")
'Select Case pword
Case Is = "Gord": Sheets("Gordsheet").Visible = True
Sheets("Dummy").Visible = False
Case Is = "Pete": Sheets("Petesheet").Visible = True
Sheets("Dummy").Visible = False
End Select
End Sub


Private Sub Workbook_BeforeClose(Cancel As Boolean)
Dim sht As Worksheet
Application.ScreenUpdating = False
Sheets("Dummy").Visible = xlSheetVisible
For Each sht In ActiveWorkbook.Sheets
If sht.Name < "Dummy" Then
sht.Visible = xlSheetVeryHidden
End If
Next sht
Application.ScreenUpdating = True
ThisWorkbook.Save
End Sub

To allow you to see all sheets and edit them.

In a general module...............

Sub UnHideAllSheets()
Application.ScreenUpdating = False
Dim n As Single
For n = 1 To Sheets.Count
Sheets(n).Visible = True
Next n
Application.ScreenUpdating = True
End Sub

Naturally you want all this code inviisble to the users.

Right-click on the workbook/project in VBE and select VBAProject Properties and
"Lock project for viewing"

Enter a password.


Gord

On Tue, 24 Jul 2007 11:14:04 -0700, David A.
wrote:

I managers that have teams. I use a workbook to track any errors that a
managers team memeber makes. I need to open just those that are assigned to
a particular manager. I don't want managers looking at other managers errors.
So if I set it up so that they creat a log in ( or I assign one) and
password it would accommplish my task.

"Gord Dibben" wrote:

The question "why do you need multiple passwords to open the workbook?" comes to
mind if users are opening just the single workbook.

Back to the question "How do I set up multiple log ins and passwords for this
workbook?"

You could have them first open a dummy workbook with select case code to trap
their login name and ask for a password that matches that name.

If correct password entered, the workbook would open.

There may be another method depending upon why you want this.

Do you want to deny access to some users?

Do you want the workbook to open with just certain sheets visible depending upon
which user opens the workbook?


Gord

On Tue, 24 Jul 2007 09:54:02 -0700, David A.
wrote:
How do I set up multible log ins and passwrods for this workbook?


"Gord Dibben" wrote:

No such thing as a Master password that overrides individual passwords

Keep a list of the users' passwords handy so's you can assist when they forget.


Gord Dibben MS Excel MVP

On Tue, 24 Jul 2007 09:02:01 -0700, David A.
wrote:

I need to let the user chose thier own password. Of course I will need a
master password for my self to reset anyone that forgets theirs. Is there a
way to do this?






David A.

How do I write a macro that will allow users to set thier own
 
This is what I was trying to do....Thank you so much.....

"Gord Dibben" wrote:

Note: the following is contingent upon users enabling macros.

If they don't only the "Dummy" sheet will be visible.

I assume you are on a network(LAN) with users logging into the system.

I would set it up so that whichever user's login name is flagged, all sheets
except that user would be hidden.

No password to open the workbook, just code to make a user's sheet visible.

In the Thisworkbook Module....................

Private Sub Workbook_Open()
Dim pword As String
Select Case Environ("Username")
'if a login is not used change to
'pword = InputBox("Enter Your Password")
'Select Case pword
Case Is = "Gord": Sheets("Gordsheet").Visible = True
Sheets("Dummy").Visible = False
Case Is = "Pete": Sheets("Petesheet").Visible = True
Sheets("Dummy").Visible = False
End Select
End Sub


Private Sub Workbook_BeforeClose(Cancel As Boolean)
Dim sht As Worksheet
Application.ScreenUpdating = False
Sheets("Dummy").Visible = xlSheetVisible
For Each sht In ActiveWorkbook.Sheets
If sht.Name < "Dummy" Then
sht.Visible = xlSheetVeryHidden
End If
Next sht
Application.ScreenUpdating = True
ThisWorkbook.Save
End Sub

To allow you to see all sheets and edit them.

In a general module...............

Sub UnHideAllSheets()
Application.ScreenUpdating = False
Dim n As Single
For n = 1 To Sheets.Count
Sheets(n).Visible = True
Next n
Application.ScreenUpdating = True
End Sub

Naturally you want all this code inviisble to the users.

Right-click on the workbook/project in VBE and select VBAProject Properties and
"Lock project for viewing"

Enter a password.


Gord

On Tue, 24 Jul 2007 11:14:04 -0700, David A.
wrote:

I managers that have teams. I use a workbook to track any errors that a
managers team memeber makes. I need to open just those that are assigned to
a particular manager. I don't want managers looking at other managers errors.
So if I set it up so that they creat a log in ( or I assign one) and
password it would accommplish my task.

"Gord Dibben" wrote:

The question "why do you need multiple passwords to open the workbook?" comes to
mind if users are opening just the single workbook.

Back to the question "How do I set up multiple log ins and passwords for this
workbook?"

You could have them first open a dummy workbook with select case code to trap
their login name and ask for a password that matches that name.

If correct password entered, the workbook would open.

There may be another method depending upon why you want this.

Do you want to deny access to some users?

Do you want the workbook to open with just certain sheets visible depending upon
which user opens the workbook?


Gord

On Tue, 24 Jul 2007 09:54:02 -0700, David A.
wrote:
How do I set up multible log ins and passwrods for this workbook?


"Gord Dibben" wrote:

No such thing as a Master password that overrides individual passwords

Keep a list of the users' passwords handy so's you can assist when they forget.


Gord Dibben MS Excel MVP

On Tue, 24 Jul 2007 09:02:01 -0700, David A.
wrote:

I need to let the user chose thier own password. Of course I will need a
master password for my self to reset anyone that forgets theirs. Is there a
way to do this?








All times are GMT +1. The time now is 09:50 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com