Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Limiting input
I have a spreadsheet that users are going to use for supply request at a
county ambulance service. Within this spreadsheet, I am using an inputbox to obtain the ambulance number (ie M13, M16,M4) for ambulances that need narcotics replaced. The max number of columns I allow in the spreadsheet is 5. Therefore, I need to limit the max allowable ambulances entered to be 5. Below, the two lines of code that obtain this info are listed first. This is followed by a For...Next loop that will ask the quantity for narcotic for each ambulance. How do I check to be sure that no more than five ambulances were entered? ambString = InputBox("Enter ambulance numbers, separated by commas ", , , 6000, 4500) ambulances = Split(ambString, ",") For i = 0 To UBound(ambulances) 'section gets narcotic order for each ambulance Next i |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Limiting input
if ubound(ambulances) 4 then
Msgbox "Too many ambulances entered, quitting" exit sub end if -- Regards, Tom Ogilvy "WLMPilot" wrote: I have a spreadsheet that users are going to use for supply request at a county ambulance service. Within this spreadsheet, I am using an inputbox to obtain the ambulance number (ie M13, M16,M4) for ambulances that need narcotics replaced. The max number of columns I allow in the spreadsheet is 5. Therefore, I need to limit the max allowable ambulances entered to be 5. Below, the two lines of code that obtain this info are listed first. This is followed by a For...Next loop that will ask the quantity for narcotic for each ambulance. How do I check to be sure that no more than five ambulances were entered? ambString = InputBox("Enter ambulance numbers, separated by commas ", , , 6000, 4500) ambulances = Split(ambString, ",") For i = 0 To UBound(ambulances) 'section gets narcotic order for each ambulance Next i |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Limiting input by date | Excel Discussion (Misc queries) | |||
Limiting edits | Excel Discussion (Misc queries) | |||
Limiting input with input box | Excel Programming | |||
limiting cell value | Excel Discussion (Misc queries) | |||
Limiting text | Excel Programming |