Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 211
Default 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
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 1,805
Default 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

  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 35,218
Default 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
  #4   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 2,344
Default 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

  #5   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 211
Default 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

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
Simple input/display question Oxylot Excel Discussion (Misc queries) 3 March 10th 08 05:35 AM
Create a box where I can input data David Excel Worksheet Functions 0 June 5th 07 08:33 PM
Excel 03 Trying to create input form Tbram Excel Discussion (Misc queries) 4 May 2nd 07 08:45 PM
Can I create an input bar? borstal Excel Worksheet Functions 1 May 23rd 06 01:26 PM
How do I create a simple macro Mrskydiver Excel Discussion (Misc queries) 1 March 13th 05 09:10 AM


All times are GMT +1. The time now is 06:18 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"