ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Inputbox "choose password" (https://www.excelbanter.com/excel-programming/311324-inputbox-choose-password.html)

Jonsson

Inputbox "choose password"
 
Hi,

I need help to create a code that ask for ""what password do you choose to
have" the first time the user tries to access the sheet.
Then, when the password once is choosed, that password is the one to be
written to get acces to the sheet.

I have several solutions to do this by entering a password in the code, but
I want the user to be able himself to choose his own password.

Any idea's?

Thanks in advance

//Thomas

--
--------------------------------------------------------------
Thomas Jonsson
ec2use - Mer tid för kunden

Telefon: 026-19 70 90
Mobil: 070- 547 80 72
--------------------------------------------------------------



Ron de Bruin

Inputbox "choose password"
 
Hi Jonsson

Do you want to run the macro bu clicking on button on a other sheet???

Is it a hidden sheet or so that you only want to show
if the user know the password. ?



--
Regards Ron de Bruin
http://www.rondebruin.nl


"Jonsson" wrote in message ...
Hi,

I need help to create a code that ask for ""what password do you choose to
have" the first time the user tries to access the sheet.
Then, when the password once is choosed, that password is the one to be
written to get acces to the sheet.

I have several solutions to do this by entering a password in the code, but
I want the user to be able himself to choose his own password.

Any idea's?

Thanks in advance

//Thomas

--
--------------------------------------------------------------
Thomas Jonsson
ec2use - Mer tid för kunden

Telefon: 026-19 70 90
Mobil: 070- 547 80 72
--------------------------------------------------------------





Ron de Bruin

Inputbox "choose password"
 
Try this

It will use the Cell IV1 to store the password
You can hide that column if you want

Sub test()
Dim Pword As Variant
With Sheets("sheet2")
If .Range("IV1").Value = "" Then
Pword = Application.InputBox("Fill in password that you want to use", "something")
If Pword = False Then
MsgBox "Fill in a the password please", _
vbOKOnly, "something"
Exit Sub
Else
.Range("IV1").Value = Pword
End If

Else
Do Until Pword = .Range("IV1").Value
Pword = Application.InputBox("Fill in the password of the Sheet", "something")
If Pword = False Then
MsgBox "Sorry you must know the password to go to this sheet", _
vbOKOnly, "something"
Exit Sub
End If
Loop
End If
.Visible = -1
.Select
End With
End Sub



--
Regards Ron de Bruin
http://www.rondebruin.nl


"Jonsson" wrote in message ...
Hi Ron!

Like this:

I have a button on sheet1 and click that button, put in the password, it
will give me access to sheet2, that is veryhidden.

//Thomas

"Ron de Bruin" skrev i meddelandet
...
Hi Jonsson

Do you want to run the macro bu clicking on button on a other sheet???

Is it a hidden sheet or so that you only want to show
if the user know the password. ?



--
Regards Ron de Bruin
http://www.rondebruin.nl


"Jonsson" wrote in message

...
Hi,

I need help to create a code that ask for ""what password do you choose

to
have" the first time the user tries to access the sheet.
Then, when the password once is choosed, that password is the one to be
written to get acces to the sheet.

I have several solutions to do this by entering a password in the code,

but
I want the user to be able himself to choose his own password.

Any idea's?

Thanks in advance

//Thomas

--
--------------------------------------------------------------
Thomas Jonsson
ec2use - Mer tid för kunden

Telefon: 026-19 70 90
Mobil: 070- 547 80 72
--------------------------------------------------------------









Jonsson

Inputbox "choose password"
 
Hi Ron,

You gave me exactly the solution I asked for!
I really apprecciate your help with this!
Thanks,

Thomas

"Ron de Bruin" skrev i meddelandet
...
Try this

It will use the Cell IV1 to store the password
You can hide that column if you want

Sub test()
Dim Pword As Variant
With Sheets("sheet2")
If .Range("IV1").Value = "" Then
Pword = Application.InputBox("Fill in password that you want

to use", "something")
If Pword = False Then
MsgBox "Fill in a the password please", _
vbOKOnly, "something"
Exit Sub
Else
.Range("IV1").Value = Pword
End If

Else
Do Until Pword = .Range("IV1").Value
Pword = Application.InputBox("Fill in the password of the

Sheet", "something")
If Pword = False Then
MsgBox "Sorry you must know the password to go to this

sheet", _
vbOKOnly, "something"
Exit Sub
End If
Loop
End If
.Visible = -1
.Select
End With
End Sub



--
Regards Ron de Bruin
http://www.rondebruin.nl


"Jonsson" wrote in message

...
Hi Ron!

Like this:

I have a button on sheet1 and click that button, put in the password, it
will give me access to sheet2, that is veryhidden.

//Thomas

"Ron de Bruin" skrev i meddelandet
...
Hi Jonsson

Do you want to run the macro bu clicking on button on a other sheet???

Is it a hidden sheet or so that you only want to show
if the user know the password. ?



--
Regards Ron de Bruin
http://www.rondebruin.nl


"Jonsson" wrote in message

...
Hi,

I need help to create a code that ask for ""what password do you

choose
to
have" the first time the user tries to access the sheet.
Then, when the password once is choosed, that password is the one to

be
written to get acces to the sheet.

I have several solutions to do this by entering a password in the

code,
but
I want the user to be able himself to choose his own password.

Any idea's?

Thanks in advance

//Thomas

--
--------------------------------------------------------------
Thomas Jonsson
ec2use - Mer tid för kunden

Telefon: 026-19 70 90
Mobil: 070- 547 80 72
--------------------------------------------------------------











Ron de Bruin

Inputbox "choose password"
 
You are welcome
Thanks for the feedback

--
Regards Ron de Bruin
http://www.rondebruin.nl


"Jonsson" wrote in message ...
Hi Ron,

You gave me exactly the solution I asked for!
I really apprecciate your help with this!
Thanks,

Thomas

"Ron de Bruin" skrev i meddelandet
...
Try this

It will use the Cell IV1 to store the password
You can hide that column if you want

Sub test()
Dim Pword As Variant
With Sheets("sheet2")
If .Range("IV1").Value = "" Then
Pword = Application.InputBox("Fill in password that you want

to use", "something")
If Pword = False Then
MsgBox "Fill in a the password please", _
vbOKOnly, "something"
Exit Sub
Else
.Range("IV1").Value = Pword
End If

Else
Do Until Pword = .Range("IV1").Value
Pword = Application.InputBox("Fill in the password of the

Sheet", "something")
If Pword = False Then
MsgBox "Sorry you must know the password to go to this

sheet", _
vbOKOnly, "something"
Exit Sub
End If
Loop
End If
.Visible = -1
.Select
End With
End Sub



--
Regards Ron de Bruin
http://www.rondebruin.nl


"Jonsson" wrote in message

...
Hi Ron!

Like this:

I have a button on sheet1 and click that button, put in the password, it
will give me access to sheet2, that is veryhidden.

//Thomas

"Ron de Bruin" skrev i meddelandet
...
Hi Jonsson

Do you want to run the macro bu clicking on button on a other sheet???

Is it a hidden sheet or so that you only want to show
if the user know the password. ?



--
Regards Ron de Bruin
http://www.rondebruin.nl


"Jonsson" wrote in message
...
Hi,

I need help to create a code that ask for ""what password do you

choose
to
have" the first time the user tries to access the sheet.
Then, when the password once is choosed, that password is the one to

be
written to get acces to the sheet.

I have several solutions to do this by entering a password in the

code,
but
I want the user to be able himself to choose his own password.

Any idea's?

Thanks in advance

//Thomas

--
--------------------------------------------------------------
Thomas Jonsson
ec2use - Mer tid för kunden

Telefon: 026-19 70 90
Mobil: 070- 547 80 72
--------------------------------------------------------------














All times are GMT +1. The time now is 05:37 PM.

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