Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default Cancel button on messagebox/inputbox

I am just wondering how to stop this from happening.

I have a series of question on a inputbox and when i click the cancel button
it just goes to the next one in line. How do I get excel to go back to the
userform called "main" when either the cancel or the x button is pressed?

Also will this work on a messagebox as well?

Thanks in advance

Greg


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4,391
Default Cancel button on messagebox/inputbox

Greg,
You need to check the return value. e.g.

If MsgBox("Is this [Some Value] correct ?", vbYesNoCancel) = vbCancel Then

With Input boxes, it depends which you are using. According to Help :
1 - VBA.InputBox Function, "If the user clicks Cancel, the function returns
a zero-length string ("")."
2 - Application.InputBox Method, "If you click the Cancel button, InputBox
returns False."

NickHK

"Greg" wrote in message
...
I am just wondering how to stop this from happening.

I have a series of question on a inputbox and when i click the cancel

button
it just goes to the next one in line. How do I get excel to go back to

the
userform called "main" when either the cancel or the x button is pressed?

Also will this work on a messagebox as well?

Thanks in advance

Greg




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
How do I capture CANCEL on an Inputbox? Toxicdistortion Excel Programming 3 October 27th 06 01:23 AM
InputBox - cancel button Greg Billinge Excel Programming 4 October 11th 04 06:45 PM
InputBox Function & Cancel Otto Moehrbach[_6_] Excel Programming 4 September 30th 04 01:13 AM
Inputbox and cancel button Uddinj1 Excel Programming 5 March 2nd 04 11:27 AM
Cancel button in Inputbox method MiRa Excel Programming 2 November 14th 03 01:04 PM


All times are GMT +1. The time now is 02:24 AM.

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"