Hi everyone,
I am using a userform to add data to my worksheet, my userform uses a combobox to to show the list that exsists but also allows for items to be added to my list. My problem is that everytime i select or add an item it continues to create duplicates please code below that i am using, is there a way to prevent the duplicates happening on the worksheet via the code and also display a message if an item is typed in that already exsists in t
I am using a userform to add data to my worksheet, my userform uses a combobox to to show the list that exsists but also allows for items to be added to my list. My problem is that everytime i select or add an item it continues to create duplicates please code below that i am using, is there a way to prevent the duplicates happening on the worksheet via the code and also display a message if an item is typed in that already exsists in t
VBA Code:
Private Sub CmdAdd_Click()
Dim rw As Long
If CmbList = "" Then
MsgBox "Please Add a Description!"
CmbList.SetFocus
Exit Sub
End If
With Sheets("Club Ledger")
Application.ScreenUpdating = False
rw = .Range("B" & .Rows.Count).End(xlUp).Row + 1
.Range("B" & rw).Value = CmbList.Value
.Range("C" & rw).Value = txtCredit.Value
.Range("D" & rw).Value = txtDebit.Value
With Sheets("PROPS")
rw = .Range("F" & .Rows.Count).End(xlUp).Row + 1
.Range("F" & rw).Value = CmbList.Value
Application.ScreenUpdating = True
End With
End With
'================================
'Clear the text boxes
'================================
CmbList.Value = ""
txtCredit.Value = ""
txtDebit.Value = ""
End Sub