Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
What would be the proper way to manage errors for a multitude of input boxes entering Strings or Longs, boxes have OK, Cancel & Red "X".
Click OK with no entry produces Type Mismatch, as does Cancel. Or one could enter text in a Long Dimmed input box. Does it make sense to have a "On Error GoTo" for each input box to go back to the same box with a MsgBox prompt? Thanks, Howard Sub EmployeeDataEnter() Dim lngLstRow& Dim EmpID As Long, ContNo As Long, SectNo As Long Dim strName As String, strEmpTyp As String, strPosTitle _ As String, strRepoMF As String EmpID = InputBox("Employee ID No.", "Employee ID") strName = InputBox("Name:", "Name of racer/owner") strEmpTyp = InputBox("Type" & vbNewLine & _ "Full Time" & vbNewLine & _ "Contract" & vbNewLine & _ "Other", "Employee Type") strPosTitle = InputBox("Type:" & vbNewLine & _ "Worker" & vbNewLine & _ "Clerical" & vbNewLine & _ "Exhibition", "Title of Worker:") strRepoMF = InputBox("Male - Female" & vbNewLine & _ "Female" & vbNewLine & _ "Male", "Repo-M/F") ContNo = InputBox("Employee Contact No.", "Contact") SectNo = InputBox("Section:", "Section") ' For a date if needed ' strDate = InputBox("Date:", "Date Enter") ' Data from input boxes added to the Master sheet" With Sheets("Master") lngLstRow = .UsedRange.Rows.Count + .UsedRange.Row .Range("A" & lngLstRow).Value = EmpID .Range("B" & lngLstRow).Value = strName .Range("C" & lngLstRow).Value = strEmpTyp .Range("D" & lngLstRow).Value = strPosTitle .Range("E" & lngLstRow).Value = strRepoMF .Range("F" & lngLstRow).Value = ContNo .Range("I" & lngLstRow).Value = SectNo End With 'Sheets("Sheet1").Select End Sub |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Create formulas using multiple pop-up input boxes? | Excel Programming | |||
VBA to manage user input in a workbook | Excel Programming | |||
Using excel to manage event - ANY input deeply appreciated! :-) | Excel Discussion (Misc queries) | |||
How do I add input data in the input ranges in drop down boxes. | Excel Discussion (Misc queries) | |||
Mask input in input boxes? | Excel Programming |