[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

Password box

Posted on 2014-08-20
2
Medium Priority
?
71 Views
Last Modified: 2014-08-20
Hi,

I have some code which asks for a pw below - when a user presses cancel, i get the message "Incorrect PW"

Can i amend the code so that no message box appears if a users presses cancel

pword = Application.InputBox("Enter password to clear log", "PASSWORD REQUIRED")
    If pword = "football" Then
        Else: MsgBox "Incorrect PW"
        Exit Sub
   End If

Open in new window

0
Comment
Question by:Seamus2626
2 Comments
 
LVL 54

Accepted Solution

by:
Rgonzo1971 earned 2000 total points
ID: 40271994
Hi,

pls try

pword = Application.InputBox("Enter password to clear log", "PASSWORD REQUIRED")
    If pword = "football" Then
        ElseIf pword = False Then
            Exit Sub
        Else: MsgBox "Incorrect PW"
            Exit Sub
   End If

' Or shorter

pword = Application.InputBox("Enter password to clear log", "PASSWORD REQUIRED")
    If pword <> "football" Then
        If pword <> False Then MsgBox "Incorrect PW"
        Exit Sub
   End If

Open in new window

Regards
0
 

Author Closing Comment

by:Seamus2626
ID: 40272160
Thanks Rgonzo!
0

Featured Post

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article descibes how to create a connection between Excel and SAP and how to move data from Excel to SAP or the other way around.
Do you use a spreadsheet like Microsoft's Excel?  Have you ever wanted to link out to a non excel file on your computer or network drive?  This is the way I found to do it!
This Micro Tutorial will demonstrate on a Mac how to change the sort order for chart legend values and decrpyt the intimidating chart menu.
This Micro Tutorial will demonstrate how to create pivot charts out of a data set. I also added a drop-down menu which allows to choose from different categories in the data set and the chart will automatically update.

834 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question