![]() |
Create a simple input box
Hello How do I create input box asking the user to type in the term of
agreement 1, 2, 3, 0r 4 years or where can I get instructions to do this. I have a book but the instructions are not very clear to me. thanks |
Create a simple input box
myNum = Application.InputBox("C")
Press ALT-11 to open VBEditor, search for InputBox. The above will prompt the user with "Enter a number" and store the response in the variable myNum. "Marilyn" wrote: Hello How do I create input box asking the user to type in the term of agreement 1, 2, 3, 0r 4 years or where can I get instructions to do this. I have a book but the instructions are not very clear to me. thanks |
Create a simple input box
Option Explicit
Sub testme() Dim myNum As Long myNum = CLng(Application.InputBox(Prompt:="1, 2, 3, or 4", Type:=1)) If myNum < 1 _ Or myNum 4 Then MsgBox "Please try again!" Exit Sub End If 'your code to do the work goes here MsgBox myNum End Sub Marilyn wrote: Hello How do I create input box asking the user to type in the term of agreement 1, 2, 3, 0r 4 years or where can I get instructions to do this. I have a book but the instructions are not very clear to me. thanks -- Dave Peterson |
Create a simple input box
Hi,
If you are in the spreadsheet, you might consider Data, Validation, List and enter 1 year, 2 years, 3 years, 4 years as the Source. Personally, I would enter the 1 year, 2 years,... in a range and reference the range in the Source box. Then click the second tab, Input Message and type a message to tell the user what you want them to do. -- Thanks, Shane Devenshire "Marilyn" wrote: Hello How do I create input box asking the user to type in the term of agreement 1, 2, 3, 0r 4 years or where can I get instructions to do this. I have a book but the instructions are not very clear to me. thanks |
Create a simple input box
Thanks, Perfect Is it possible to have the answer entered in a cell , that is if the answer is 2 the number 2 appear in cell D5 thanks again "Dave Peterson" wrote: Option Explicit Sub testme() Dim myNum As Long myNum = CLng(Application.InputBox(Prompt:="1, 2, 3, or 4", Type:=1)) If myNum < 1 _ Or myNum 4 Then MsgBox "Please try again!" Exit Sub End If 'your code to do the work goes here MsgBox myNum End Sub Marilyn wrote: Hello How do I create input box asking the user to type in the term of agreement 1, 2, 3, 0r 4 years or where can I get instructions to do this. I have a book but the instructions are not very clear to me. thanks -- Dave Peterson |
All times are GMT +1. The time now is 09:55 AM. |
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com