+ Reply to Thread
Results 1 to 5 of 5

Check if entry on userform is not a duplicate before pasting on the worksheet

  1. #1
    Forum Contributor
    Join Date
    09-02-2013
    Location
    London
    MS-Off Ver
    Excel 2019
    Posts
    368

    Check if entry on userform is not a duplicate before pasting on the worksheet

    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.

    Please Login or Register  to view this content.
    Unsure what's missing from the code or what I am doing incorrectly but I would appreciate some help please.

    Thank you.
    Attached Images Attached Images
    Last edited by rakotonirinas; 12-20-2018 at 07:47 AM.

  2. #2
    Forum Expert nigelog's Avatar
    Join Date
    12-14-2007
    Location
    Cork, Ireland
    MS-Off Ver
    Office 365 Windows 10
    Posts
    2,293

    Re: Check if entry on userform is not a duplicate before pasting on the worksheet

    Exactly what comboboxes are "Supplier" and "Reporting Month"

  3. #3
    Forum Contributor
    Join Date
    09-02-2013
    Location
    London
    MS-Off Ver
    Excel 2019
    Posts
    368

    Re: Check if entry on userform is not a duplicate before pasting on the worksheet

    ComboBox 3 and 9 respectively.

  4. #4
    Forum Contributor
    Join Date
    09-02-2013
    Location
    London
    MS-Off Ver
    Excel 2019
    Posts
    368

    Re: Check if entry on userform is not a duplicate before pasting on the worksheet

    @nigelog. I think you didi ask similar question a while back, didn't you?

  5. #5
    Forum Contributor
    Join Date
    09-02-2013
    Location
    London
    MS-Off Ver
    Excel 2019
    Posts
    368

    Re: Check if entry on userform is not a duplicate before pasting on the worksheet

    I'm wondering whether the evaluate command will be the best to use here.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Replies: 0
    Last Post: 10-11-2017, 03:19 PM
  2. [SOLVED] Copy a row, check table for duplicate, give option to overwrite duplicate before pasting
    By Frankie_The_Flyer in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 07-11-2017, 09:56 PM
  3. Replies: 4
    Last Post: 08-21-2015, 03:59 PM
  4. Userform to check 2 textboxes for duplicate & date check
    By LadyAlina in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 03-24-2015, 09:26 AM
  5. Replies: 0
    Last Post: 02-04-2014, 12:36 AM
  6. userform duplicate entry check writing to sheet
    By cfinch100 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 01-06-2013, 06:21 AM
  7. Code to check for duplicate entry
    By renden in forum Excel Programming / VBA / Macros
    Replies: 10
    Last Post: 08-02-2012, 05:00 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1