LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 26
Default Doing nothing when pressing Cancel on InputBox

Hello Guys, a rather simple thing, yet i don't know why it does not work:

the code asks simply for a password, if the password is correct, perform the
code. Or if the user typed nothing in the inputbox, or pressed Cancel, do
nothing. If the password is wrong, give message "wrong password".


response = InputBox("give password: ") = "abcdefg"
If response = vbNullString Then Exit Sub 'This code should exit the sub if
no typing or pressed on Cancel button
If response = "abcdefg" Then
'Code to execute Else
MsgBox "password incorrect!", vbCritical
End If

this doesn't work as it should, any ideas what's wrong?

Thanks in advance.

 
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
Test for Cancel in Inputbox Fred Smith Excel Programming 5 April 6th 07 03:36 AM
How do I capture CANCEL on an Inputbox? Toxicdistortion Excel Programming 3 October 27th 06 01:23 AM
How do I capture CANCEL on an Inputbox? Toxicdistortion Excel Programming 0 October 27th 06 12:37 AM
Help with inputbox (Distinguish OK from Cancel) NooK[_47_] Excel Programming 3 August 5th 04 11:45 AM
Clicking Cancel on an Inputbox rott[_6_] Excel Programming 3 March 5th 04 02:57 AM


All times are GMT +1. The time now is 06:30 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"