View Single Post
  #10   Report Post  
Posted to microsoft.public.excel.programming
L. Howard L. Howard is offline
external usenet poster
 
Posts: 852
Default Manage errors with multiple InPut Boxes

On Monday, September 28, 2015 at 5:59:21 AM UTC-7, GS wrote:
I like to display a userform when collecting multiple fields of data
input. This just makes it a better experience for users over having to
respond to multiple inputbox prompts.

You can validate each input field (TextBox/DatePicker/SpinCountr or
whatever) before proceeding, forcing the user to provide only valid
data or cancel!

--
Garry


Hi Garry,

Here is what I'm using, it has a combination of text and ID numbers, perhaps an ID "number" may have a letter something like 1234ER, and Section is a number all others are strings.

Out put is always text but is not used in formulas in this useage.

Howard

Sub Inputbox_Comma()
Dim Empl_Info, i As Long
Dim myArr As Variant

Empl_Info = Application.InputBox(prompt:="Use a comma ( , ) as Delimiter" & vbCr & vbCr & _
"Example - 12345,Name,Type etc." & vbCr & _
"and a SPACE to skip an entry." & vbCr & vbCr & _
"1 - Employee ID" & vbCr & _
"2 - Name" & vbCr & _
"3 - Title " & vbCr & _
"5 - M/F Reproductive" & vbCr & _
"6 - Contact" & vbCr & _
"7 - Division" & vbCr & _
"8 - Deptartment" & vbCr & _
"9 - Section" & vbCr & _
"10 - Supervisor" & vbCr & _
"11 - Crew" & vbCr & _
"12 - Role Description" & vbCr, _
Title:="Employee Information New Entry", Type:=2)

If Len(Empl_Info) = 0 Then
MsgBox "No Entry"
Exit Sub
ElseIf Empl_Info = False Then
Exit Sub
End If

myArr = Split(Empl_Info, ",")

With Sheets("Master")
.Cells(Rows.Count, 1).End(xlUp)(2) _
.Resize(columnsize:=UBound(myArr) + 1) = myArr
End With

End Sub