Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
CLR CLR is offline
external usenet poster
 
Posts: 594
Default How to "Quit"....Input Box

Hi All.........

k = InputBox("Enter Lastname, Firstname")

I have the above line in my macro, and once the box appears on the screen,
there is no way to QUIT the program............how do I add a "QUIT" button
to the box, please?

TIA
Vaya con Dios,
Chuck, CABGx3



  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 35,218
Default How to "Quit"....Input Box

You can't change that inputbox, but you could do something like:

dim k as string
k = inputbox(prompt:="...")
if trim(k)="" then
exit sub
end if

'keep going...

CLR wrote:

Hi All.........

k = InputBox("Enter Lastname, Firstname")

I have the above line in my macro, and once the box appears on the screen,
there is no way to QUIT the program............how do I add a "QUIT" button
to the box, please?

TIA
Vaya con Dios,
Chuck, CABGx3


--

Dave Peterson
  #3   Report Post  
Posted to microsoft.public.excel.programming
CLR CLR is offline
external usenet poster
 
Posts: 594
Default How to "Quit"....Input Box

Okey doke...............that's some help, thanks much Dave......

Vaya con Dios,
Chuck, CABGx3


"Dave Peterson" wrote in message
...
You can't change that inputbox, but you could do something like:

dim k as string
k = inputbox(prompt:="...")
if trim(k)="" then
exit sub
end if

'keep going...

CLR wrote:

Hi All.........

k = InputBox("Enter Lastname, Firstname")

I have the above line in my macro, and once the box appears on the

screen,
there is no way to QUIT the program............how do I add a "QUIT"

button
to the box, please?

TIA
Vaya con Dios,
Chuck, CABGx3


--

Dave Peterson



  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,986
Default How to "Quit"....Input Box

If you really want to quit the program, you can use the Cancel button with
this code:

If k = "" Or k = False Then
ThisWorkbook.Saved = True
Application.Quit
End If

A word of caution! If you have other workbooks open, this will affect them.
It also closes without saving anything in the ThisWorkbook sheets that may
have been added or changed during this session.

"CLR" wrote:

Hi All.........

k = InputBox("Enter Lastname, Firstname")

I have the above line in my macro, and once the box appears on the screen,
there is no way to QUIT the program............how do I add a "QUIT" button
to the box, please?

TIA
Vaya con Dios,
Chuck, CABGx3




  #5   Report Post  
Posted to microsoft.public.excel.programming
CLR CLR is offline
external usenet poster
 
Posts: 594
Default How to "Quit"....Input Box

Ok...........thank you kindly.........I appreciate that.

Vaya con Dios,
Chuck, CABGx3


"JLGWhiz" wrote in message
...
If you really want to quit the program, you can use the Cancel button with
this code:

If k = "" Or k = False Then
ThisWorkbook.Saved = True
Application.Quit
End If

A word of caution! If you have other workbooks open, this will affect

them.
It also closes without saving anything in the ThisWorkbook sheets that

may
have been added or changed during this session.

"CLR" wrote:

Hi All.........

k = InputBox("Enter Lastname, Firstname")

I have the above line in my macro, and once the box appears on the

screen,
there is no way to QUIT the program............how do I add a "QUIT"

button
to the box, please?

TIA
Vaya con Dios,
Chuck, CABGx3






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
Excel - Golf - how to display "-2" as "2 Under" or "4"as "+4" or "4 Over" in a calculation cell Steve Kay Excel Discussion (Misc queries) 2 August 8th 08 01:54 AM
When I input "25:03" as a time, it reads "1:03" Darryl_Neeley Excel Discussion (Misc queries) 9 September 26th 07 09:20 PM
"Getting Rid Of Save Prompt On Quit Command" Don Excel Programming 3 July 16th 07 07:32 AM
"Cannot quit Excel" after tried to access protected WB tskogstrom Excel Programming 2 December 13th 06 03:37 AM
Change default in input box from "20" to "000000"? Have macro continue on to name sheet tab? StargateFanFromWork[_4_] Excel Programming 7 October 29th 06 11:46 AM


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