Hello,
I'm trying to record data by using a userform which will then write/paste values of boxes in the userform to a Sales worksheet. Instead of writing/pasting directly values on the userform, I would like first once the userform 'Record' button is clicked to check whether 2 values (Supplier and Reporting Month) of the userform are not already recorded on the worksheet. If these 2 values exist already simultaneously, then a "Duplicate" message box pops. Then Exit the Sub and clear all the contents of the userform. Otherwise, it will writ e the userform values to a new line (row) on the Sales worksheet.
Below is the code I wrote with some help to achieve it. The issue though is that it always comes up with the message box and always copying the values on the worksheet even though it's a duplicate.
Unsure what's missing from the code or what I am doing incorrectly but I would appreciate some help please.
Thank you.
Bookmarks