i have a userform with 3 drop down selection lists. everytime i click the arrow to list the dropdown it duplicates whats in the list over and over and over until i close the userform and re open it. is there some simple code that i can add to the userform to stop it from duplicating the lists.
Private Sub cmdAdd_Click()
'Copy input values to sheet.
Dim lRow As Long
Dim ws As Worksheet
Set ws = Worksheets("UserForm1")
lRow = ws.Cells(Rows.Count, 1).End(xlUp).Offset(1, 0).Row
With ws
.Cells(lRow, 1).Value = Me.txtVin.Value
.Cells(lRow, 4).Value = Me.cboPassFail.Value
.Cells(lRow, 5).Value = Me.cboOperator.Value
.Cells(lRow, 6).Value = Me.cboQC.Value
.Cells(lRow, 7).Value = Me.txtComment.Value
End With
'Clear input controls.
Me.txtVin.Value = ""
Me.cboPassFail.Value = ""
Me.cboOperator.Value = ""
Me.cboQC.Value = ""
Me.txtComment.Value = ""
End Sub
Private Sub cboPassFail_DropButt*******()
'Populate control.
Me.cboPassFail.AddItem "PASS"
Me.cboPassFail.AddItem "FAIL"
End Sub
Private Sub cboOperator_DropButt*******()
'Populate control.
Me.cboOperator.AddItem "Willson"
Me.cboOperator.AddItem "Jerry"
Me.cboOperator.AddItem "Billy"
Me.cboOperator.AddItem "Adam"
Me.cboOperator.AddItem "John"
End Sub
Private Sub cboQC_DropButt*******()
'Populate control.
Me.cboQC.AddItem "SUPPLIER"
End Sub
Private Sub cmdClose_Click()
'Close UserForm.
Unload Me
End Sub
Private Sub TextTrans_Change()
End Sub
Private Sub Label11_Click()
End Sub
Private Sub Label12_Click()
End Sub
Private Sub Label9_Click()
End Sub
Private Sub txtEngine_Change()
End Sub
Private Sub cmdAdd_Click()
'Copy input values to sheet.
Dim lRow As Long
Dim ws As Worksheet
Set ws = Worksheets("UserForm1")
lRow = ws.Cells(Rows.Count, 1).End(xlUp).Offset(1, 0).Row
With ws
.Cells(lRow, 1).Value = Me.txtVin.Value
.Cells(lRow, 4).Value = Me.cboPassFail.Value
.Cells(lRow, 5).Value = Me.cboOperator.Value
.Cells(lRow, 6).Value = Me.cboQC.Value
.Cells(lRow, 7).Value = Me.txtComment.Value
End With
'Clear input controls.
Me.txtVin.Value = ""
Me.cboPassFail.Value = ""
Me.cboOperator.Value = ""
Me.cboQC.Value = ""
Me.txtComment.Value = ""
End Sub
Private Sub cboPassFail_DropButt*******()
'Populate control.
Me.cboPassFail.AddItem "PASS"
Me.cboPassFail.AddItem "FAIL"
End Sub
Private Sub cboOperator_DropButt*******()
'Populate control.
Me.cboOperator.AddItem "Willson"
Me.cboOperator.AddItem "Jerry"
Me.cboOperator.AddItem "Billy"
Me.cboOperator.AddItem "Adam"
Me.cboOperator.AddItem "John"
End Sub
Private Sub cboQC_DropButt*******()
'Populate control.
Me.cboQC.AddItem "SUPPLIER"
End Sub
Private Sub cmdClose_Click()
'Close UserForm.
Unload Me
End Sub
Private Sub TextTrans_Change()
End Sub
Private Sub Label11_Click()
End Sub
Private Sub Label12_Click()
End Sub
Private Sub Label9_Click()
End Sub
Private Sub txtEngine_Change()
End Sub