Input Box

  • Thread starter Thread starter Greg B.
  • Start date Start date
G

Greg B.

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
 
Thanks for your help

Greg B

bethg7 said:
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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top