Hello,
I have created a command button that i want to collect different pieces of information. I have figured out how to do so with an InputBox. The issue i am facing is that i would like the user to have a dropdown box to input the information instead of typing it into the inputbox. This would guarantee that some of the inputs will stay constant for sorting the data at a later time(example First, Second, Third Shift). I have attached my code so far.
Private Sub CommandButton1_Click()
Dim RowHolder As Integer
Dim OperatorID As Variant
Dim JobnumberID As Variant
Dim ShiftID As Variant
Dim MachineID As Variant
Dim QuantityID As Variant
Dim DefectID As Variant
RowHolder = 1
OperatorID = InputBox("Enter Employee ID")
Do Until (IsEmpty(Cells(RowHolder, 2)))
RowHolder = RowHolder + 1
Loop
ShiftID = InputBox("Select Shift")
JobnumberID = InputBox("Enter Job Number")
MachineID = InputBox("Enter Machine ID Number")
QuantityID = InputBox("Enter Number of Scrapped Parts")
DefectID = InputBox("Reason for scrapping parts")
Range("B" & RowHolder).Value = OperatorID
Range("C" & RowHolder).Value = ShiftID
Range("D" & RowHolder).Value = JobnumberID
Range("E" & RowHolder).Value = MachineID
Range("F" & RowHolder).Value = QuantityID
Range("G" & RowHolder).Value = DefectID
End Sub
Thanks,
Joe
I have created a command button that i want to collect different pieces of information. I have figured out how to do so with an InputBox. The issue i am facing is that i would like the user to have a dropdown box to input the information instead of typing it into the inputbox. This would guarantee that some of the inputs will stay constant for sorting the data at a later time(example First, Second, Third Shift). I have attached my code so far.
Private Sub CommandButton1_Click()
Dim RowHolder As Integer
Dim OperatorID As Variant
Dim JobnumberID As Variant
Dim ShiftID As Variant
Dim MachineID As Variant
Dim QuantityID As Variant
Dim DefectID As Variant
RowHolder = 1
OperatorID = InputBox("Enter Employee ID")
Do Until (IsEmpty(Cells(RowHolder, 2)))
RowHolder = RowHolder + 1
Loop
ShiftID = InputBox("Select Shift")
JobnumberID = InputBox("Enter Job Number")
MachineID = InputBox("Enter Machine ID Number")
QuantityID = InputBox("Enter Number of Scrapped Parts")
DefectID = InputBox("Reason for scrapping parts")
Range("B" & RowHolder).Value = OperatorID
Range("C" & RowHolder).Value = ShiftID
Range("D" & RowHolder).Value = JobnumberID
Range("E" & RowHolder).Value = MachineID
Range("F" & RowHolder).Value = QuantityID
Range("G" & RowHolder).Value = DefectID
End Sub
Thanks,
Joe