Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Is it possible to have an input box with two or more entry boxes in it or am
I just limited to creating user forms for that? Thanks, Kevin |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
The input box only allows one entry, although it can be of variable length.
The InputBox method offers a way to limit the input to specific data types, whereas the InputBox function returns only strings. I don't understand the two boxes question. "Kevin" wrote: Is it possible to have an input box with two or more entry boxes in it or am I just limited to creating user forms for that? Thanks, Kevin |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Like if I wanted an Input box to ask for name and date or something.
"JLGWhiz" wrote: The input box only allows one entry, although it can be of variable length. The InputBox method offers a way to limit the input to specific data types, whereas the InputBox function returns only strings. I don't understand the two boxes question. "Kevin" wrote: Is it possible to have an input box with two or more entry boxes in it or am I just limited to creating user forms for that? Thanks, Kevin |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
If you want two data elements that would be entered on a sheet somewhere in
separate cells, then probably the UserForm with a couple of TextBox controls would be the easiest to work with. Dave's suggestion of using an array for the InputBox method would need some programming savvy to work with, but is feasible also. My personal preference would be the UserForm with TextBoxes. "Kevin" wrote: Like if I wanted an Input box to ask for name and date or something. "JLGWhiz" wrote: The input box only allows one entry, although it can be of variable length. The InputBox method offers a way to limit the input to specific data types, whereas the InputBox function returns only strings. I don't understand the two boxes question. "Kevin" wrote: Is it possible to have an input box with two or more entry boxes in it or am I just limited to creating user forms for that? Thanks, Kevin |
#5
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
As a user, I would much rather see a userform with separate areas for each
response--or even a couple of inputboxes... But if you wanted, you could use application.inputbox() and ask for an array to be returned: Option Explicit Sub testme() Dim myArr As Variant Dim iCtr As Long Dim userCancelled As Boolean Dim resp As Long myArr = Application.InputBox(prompt:="Three values", Type:=64 + 2, _ Default:=Array("first", "second", "third")) userCancelled = False For iCtr = LBound(myArr) To UBound(myArr) If myArr(iCtr) = False Then userCancelled = True End If MsgBox myArr(iCtr) Next iCtr If userCancelled Then Exit Sub End If 'more code here End Sub You could also use: Sub testme2() Dim myArr As Variant Dim iCtr As Long Dim userCancelled As Boolean Dim resp As Long myArr = Application.InputBox(prompt:="Multiple values", Type:=64) userCancelled = False For iCtr = LBound(myArr) To UBound(myArr) If myArr(iCtr) = False Then userCancelled = True End If MsgBox myArr(iCtr) Next iCtr If userCancelled Then Exit Sub End If 'more code here End Sub and have the user type the response as: {"asdf",1,"qwer",17} Replace the comma with the user's windows list separator Kevin wrote: Is it possible to have an input box with two or more entry boxes in it or am I just limited to creating user forms for that? Thanks, Kevin -- Dave Peterson |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
input in number form is being multiplied by 1000 when i input. | Excel Discussion (Misc queries) | |||
Have user input converted to uppercase in same cell as input? | New Users to Excel | |||
How do I add input data in the input ranges in drop down boxes. | Excel Discussion (Misc queries) | |||
=SUMIF(Input!H2:H718,AZ19,Input!E2:E685)AND(IF | Excel Worksheet Functions | |||
CODE to select range based on User Input or Value of Input Field | Excel Programming |