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

I have the following

Sub Admin()
Dim Pass

Pass = InputBox("Please Enter Password to Log in as Admin")

If Pass = "1234" Then
Application.Run Macro:="showme"
Application.Run Macro:="Sheets_Show"
' Application.Run Macro:="Unprotect"
Else
MsgBox "Sorry Wrong Password"
Worksheets("Till").Select
Range("B10").Select
End If
End Sub

i know im prob pushing it a little, but is there a way to blank put
what i type so others cant see the password.

Thanks you


---
Message posted from http://www.ExcelForum.com/

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,089
Default Blanked Password enter

Not with an InputBox. You'll need to define a UserForm with a Text Field.
You can then define the PasswordChar to be an "*" or whatever.

Regards

Trevor


"mushy_peas " wrote in message
...
I have the following

Sub Admin()
Dim Pass

Pass = InputBox("Please Enter Password to Log in as Admin")

If Pass = "1234" Then
Application.Run Macro:="showme"
Application.Run Macro:="Sheets_Show"
' Application.Run Macro:="Unprotect"
Else
MsgBox "Sorry Wrong Password"
Worksheets("Till").Select
Range("B10").Select
End If
End Sub

i know im prob pushing it a little, but is there a way to blank put
what i type so others cant see the password.

Thanks you


---
Message posted from http://www.ExcelForum.com/



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 117
Default Blanked Password enter

Hi Mushy...

I have a workbook that was a download from Ozgrid, written by a guy
called Dave Hawley... it does exactly what you want...
You can change the password, username and the form to whatever
you want... if you want it I will send it over..

seeya ste
  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 117
Default Blanked Password enter

Hi Mushy...

I have a workbook that was a download from Ozgrid, written by a guy
called Dave Hawley... it does exactly what you want...
You can change the password, username and the form to whatever
you want... if you want it I will send it over..

seeya ste
  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Blanked Password enter

thanks ste, that would be cool..


--
Message posted from
http://www.ExcelForum.com



  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Blanked Password enter

Actually i figured it out. Just used a user form. If any1 wants to know,
email me(above) or reply here.

Thanks Trev & Ste


---
Message posted from http://www.ExcelForum.com/

  #7   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Blanked Password enter

NO!!!!!!!

Got 1 small prob and a "would be nice"

1. small prob is that if no password is put in, then i get an error

2. i use a macro to start the useform, but can i get the cursor to go
to the textbox, and when i hit the ENTER key, it presses the OK
button.

this would be the icing on the cake, but this is so cool!


---
Message posted from http://www.ExcelForum.com/

  #8   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Blanked Password enter

having an empty textbox, in and of itself does not raise an error - so the
error must be in your code. You need to check for this condition and react
accordingly.

Set the tabindex property of the textbox to 0

for the OK button, set the "default" property to True


--
Regards,
Tom Ogilvy

mushy_peas wrote in message
...
NO!!!!!!!

Got 1 small prob and a "would be nice"

1. small prob is that if no password is put in, then i get an error

2. i use a macro to start the useform, but can i get the cursor to go
to the textbox, and when i hit the ENTER key, it presses the OK
button.

this would be the icing on the cake, but this is so cool!


---
Message posted from http://www.ExcelForum.com/



  #9   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Blanked Password enter

hey Tom
i have this
Dim Password As String
With EnterPass
.TextBox1.Text = ""
.Show
If .Tag = vbOK Then
Password = .TextBox1.Text
Else
Worksheets("Till").Select
Range("B10").Select
End If


Im im not sure what goes after the Else to close the the box, which i
what i think is casung the error

--
Message posted from http://www.ExcelForum.com

  #10   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Blanked Password enter

Dim Password As String
With EnterPass
TextBox1.Text = ""
.Show
End With
If EnterPass.Tag = vbOK Then
Password = EnterPass.TextBox1.Text
Else
Worksheets("Till").Select
Range("B10").Select
End If
unload EnterPass

You should have code to hide EnterPass in the code module of the userform.

Private Sub OK_Click()
me.hide
End Sub

--
Regards,
Tom Ogilvy


mushy_peas wrote in message
...
hey Tom
i have this
Dim Password As String
With EnterPass
TextBox1.Text = ""
Show
If .Tag = vbOK Then
Password = .TextBox1.Text
Else
Worksheets("Till").Select
Range("B10").Select
End If


Im im not sure what goes after the Else to close the the box, which is
what i think is casung the error.


---
Message posted from http://www.ExcelForum.com/





  #11   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Blanked Password enter

Tom,
i copied ur code, but i still cant get it to work properly.

If i put a password, its fine even if its wrong. but if i leave th
textbox empty and press OK, or the close X in the top right, it give
me

Run-time error "13":
Type mismatc

--
Message posted from http://www.ExcelForum.com

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 to enter the sheet Tia[_3_] Excel Worksheet Functions 6 October 13th 08 10:37 PM
Don't Want to Print Formated Blanked Out Cells GPIE Excel Discussion (Misc queries) 1 March 15th 07 04:09 PM
Why is Page Setup Comment Box blanked in Excel 2003? Heyvet New Users to Excel 2 January 21st 06 07:46 PM
How to use macro to enter password? Ankan[_4_] Excel Programming 1 December 23rd 03 12:12 AM
Macro to go a WEB site and enter a password Bob Benjamin Excel Programming 7 November 14th 03 03:34 PM


All times are GMT +1. The time now is 12:40 PM.

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

About Us

"It's about Microsoft Excel"