ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Input Box (https://www.excelbanter.com/excel-programming/380790-input-box.html)

Greg B.[_2_]

Input Box
 
Dim search1
search1 = InputBox("i.e John Doe", ("WHAT IS THE PLAYERS NAME?"))

Hi all above is my code for an input box.

I have a question about a few things.

How do I get the input box to exit sub when the cancel box or X button is
clicked?

How do I get the inputbox to stay up when the ok button is clicked with no
input in the box?

Thanks for any advise on this issue

Greg B



No Name

Input Box
 
Thanks for your help

Greg B

"bethg7" wrote in message
...
Maybe this will help. For my input box, you can choose either "D", "P",
or
Enter.
You should use an IF/Then/Else statement to program what to do when Cancel
is pressed.

Message = "Do you want to apply a DISCOUNT Or PENALY (D,P)"
theReply = InputBox(Message)
If UCase(theReply) = ("D") Then
Discount
ElseIf UCase(theReply) = ("P") Then
Penalty
Else: Range("A2").Select



"Greg B." wrote:

Dim search1
search1 = InputBox("i.e John Doe", ("WHAT IS THE PLAYERS NAME?"))

Hi all above is my code for an input box.

I have a question about a few things.

How do I get the input box to exit sub when the cancel box or X button is
clicked?

How do I get the inputbox to stay up when the ok button is clicked with
no
input in the box?

Thanks for any advise on this issue

Greg B





All times are GMT +1. The time now is 07:52 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com