Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 57
Default Input box for multiple entries

Is it possible to have one input box that asks 1-4 questions, then take the
user answer & plunk them ins a desired cell?

Or is only 1 questions per input box allowed?
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,939
Default Input box for multiple entries

If you have 4 questions I would be more inclined to use a User Form with 4
text boxes. One input box askes only one question. In a form you can embed as
many questions as you want...
--
HTH...

Jim Thomlinson


"Munchkin" wrote:

Is it possible to have one input box that asks 1-4 questions, then take the
user answer & plunk them ins a desired cell?

Or is only 1 questions per input box allowed?

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,565
Default Input box for multiple entries

I think it is better expressed that the Inputbox will only return one value.
Why not explain what your objective is and maybe someone can offer a
solution?


"Munchkin" wrote in message
...
Is it possible to have one input box that asks 1-4 questions, then take
the
user answer & plunk them ins a desired cell?

Or is only 1 questions per input box allowed?



  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,069
Default Input box for multiple entries

It can be done using a couple of arrays & a function but as Jim has already
stated, userform would be easier.

However, if you want to pursue the inputbox idea then try the following as
an approach - it asks six questions which are stored in an array. I have
displayed these values in msgbox but you would use them as required in your
application.

Post all code in standard module (not fully tested)

Dim Title As String
Sub EnterData()
Dim myarray(6) As Variant
Dim Entryarray()

Title = "Enter Company Data"

Entryarray = Array("Company Name", _
"Address", _
"Telephone No", _
"Business Sector", _
"Contact Name", _
"Contact Email")

i = 0

Do
'msgbox msg shown
when
'value set to 1
(required entry)
'inputbox prompt 'set to 0 when
blank entry valid
myarray(i) = get_Input("Enter " & Entryarray(i), Entryarray(i), 1)

If myarray(i) = False Then Exit Sub

i = i + 1

Loop Until i 5

'sample code to show array data
i = 0

Do

MsgBox myarray(i)

i = i + 1

Loop Until i 5

End Sub

Function get_Input(msg, entry, eflag)
Rem eflag determines whether the prompt msgbox
Rem is displayed when nothing is input

label:

userin = Application.InputBox(msg, Title)

If userin = False Then

msg1 = MsgBox("You pressed CANCEL - Do you want to Exit?", 292, Title)

If msg1 = 7 Then

GoTo label

Else

Exit Function

End If

ElseIf userin = "" And eflag = 1 Then

Prompt = MsgBox("Nothing Input!" & Chr(10) & entry & " MUST be
Entered", 48, entry)

GoTo label

End If

get_Input = userin

End Function

Hope helpful


--
jb


"Munchkin" wrote:

Is it possible to have one input box that asks 1-4 questions, then take the
user answer & plunk them ins a desired cell?

Or is only 1 questions per input box allowed?

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
multiple entries / multiple criteria Kevin Excel Discussion (Misc queries) 0 April 7th 08 05:11 PM
Combine Multiple Entries with differing amounts of entries Katie Excel Worksheet Functions 2 November 28th 07 09:53 PM
Calculate multiple results from multiple input values? Jetta1515 Excel Discussion (Misc queries) 5 June 1st 06 03:09 PM
Date and time stamping multiple cells for multiple entries. Gerald Excel Worksheet Functions 1 May 9th 06 01:45 PM
How to constrain input to previous entries SMUDGER New Users to Excel 1 January 20th 06 02:39 PM


All times are GMT +1. The time now is 12:58 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"