Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 52
Default Password in a macro

I have a macro which requests a password before allowing one to change a
worksheet. I do not want the password to be case sensitive. My code follows:

On error GoTo Error
If TextBox1.Text < "groupproject" Then
Unload UserFormPassword

GoTo Error
Exit Sub
Else Unload Password_UserForm
New_Or_Edit.Show

End If
Exit Sub
Error:

Unload Password_UserForm
Invalid_Password.Show


What can be done to make this NOT case sensitive?
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,939
Default Password in a macro

Use the UCase (or LCase) function to check the Upper case value of what was
entered against the Upper case value of the password. Make sure to UCase both
sides (the entry and the password).
--
HTH...

Jim Thomlinson


"ordnance1" wrote:

I have a macro which requests a password before allowing one to change a
worksheet. I do not want the password to be case sensitive. My code follows:

On error GoTo Error
If TextBox1.Text < "groupproject" Then
Unload UserFormPassword

GoTo Error
Exit Sub
Else Unload Password_UserForm
New_Or_Edit.Show

End If
Exit Sub
Error:

Unload Password_UserForm
Invalid_Password.Show


What can be done to make this NOT case sensitive?

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 258
Default Password in a macro

Thanks!

Could not get that to work the way I wanted, but came up with this:

With TextBox1
.Value = LCase(.Value)
End With

Placed at the beginning of my code, it did the job.

"Jim Thomlinson" wrote in message
...
Use the UCase (or LCase) function to check the Upper case value of what
was
entered against the Upper case value of the password. Make sure to UCase
both
sides (the entry and the password).
--
HTH...

Jim Thomlinson


"ordnance1" wrote:

I have a macro which requests a password before allowing one to change a
worksheet. I do not want the password to be case sensitive. My code
follows:

On error GoTo Error
If TextBox1.Text < "groupproject" Then
Unload UserFormPassword

GoTo Error
Exit Sub
Else Unload Password_UserForm
New_Or_Edit.Show

End If
Exit Sub
Error:

Unload Password_UserForm
Invalid_Password.Show


What can be done to make this NOT case sensitive?



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
Password protection in macro ( Anybody can view my password in VB Sherees Excel Discussion (Misc queries) 2 January 24th 10 10:05 PM
How to see macro code of a password protected macro without a password? Dmitry Kopnichev Excel Worksheet Functions 5 October 27th 05 09:57 AM
How to see macro code of a password protected macro without a password? Dmitry Kopnichev Excel Programming 5 October 27th 05 09:57 AM
Macro Password Ryan Coutinho Excel Programming 2 May 21st 04 09:45 AM
macro password Ronbo Excel Programming 1 May 11th 04 05:24 PM


All times are GMT +1. The time now is 04:13 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"