#1   Report Post  
Nick
 
Posts: n/a
Default Slight Problem

I have the following code but when the cancel button on my input box is
pressed the "invalid password" message is still displayed. Can someone help
so when the cancel button is pressed then that is exactly what happens, the
input box is cancelled.

Dim MyStr1 As String, MyStr2 As String
MyStr2 = ("engineering")
MyStr1 = InputBox("Please Enter The Required Password")
If MyStr1 = MyStr2 Then
Sheets("Sheet2").Select
Range("A9").Select
Else
MsgBox "Incorrect Password. Access Denied", vbCritical
Range("E22").Select
End If
  #2   Report Post  
dominicb
 
Posts: n/a
Default


Good afternoon Nick

Enter this line immediately after the line that opens the InputBox:

If MyStr1 = "" Then Exit Sub

HTH

DominicB


--
dominicb
------------------------------------------------------------------------
dominicb's Profile: http://www.excelforum.com/member.php...o&userid=18932
View this thread: http://www.excelforum.com/showthread...hreadid=383168

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
Slight problem automating Excel in a service someone Setting up and Configuration of Excel 2 May 13th 05 10:04 PM
Excel Display Problem Bill Martin -- (Remove NOSPAM from address) Excel Discussion (Misc queries) 0 April 19th 05 05:25 PM
autofilter problem emre Excel Worksheet Functions 0 March 29th 05 10:19 PM
Freeze Pane problem in shared workbooks JM Excel Discussion (Misc queries) 1 February 1st 05 12:04 AM
Row Autofit problem Excel 2003 Matthias Klaey Excel Discussion (Misc queries) 0 January 19th 05 05:33 PM


All times are GMT +1. The time now is 05:52 AM.

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"