+ Reply to Thread
Results 1 to 5 of 5

Userform detects entire duplicate row before entering information

  1. #1
    Registered User
    Join Date
    08-09-2016
    Location
    birmingha, england
    MS-Off Ver
    2010
    Posts
    25

    Userform detects entire duplicate row before entering information

    Hi there,

    I'm trying to get my userform interface to:

    When I enter the information and press 'OK', before it records the information into the spreadsheet, it will search the rows in the spreadsheet and see if the exact same data has already been entered.

    If the data has been entered a message box will appear stating "Duplicate Entry. Userform already exists. Proceed anyway, yes or no?"

    Here is the userform code:
    Please Login or Register  to view this content.

    Thanks!

  2. #2
    Forum Expert mikerickson's Avatar
    Join Date
    03-30-2007
    Location
    Davis CA
    MS-Off Ver
    Excel 2011
    Posts
    6,229

    Re: Userform detects entire duplicate row before entering information

    You could add this section of code.
    You also might want to change (or omit) the OR branch to avoid checking common duplicate fields, like Departmet, and only check the unique ones, like Name. If partial duplicates are expected, then that whole branch should be omitted.

    Please Login or Register  to view this content.
    _
    ...How to Cross-post politely...
    ..Wrap code by selecting the code and clicking the # or read this. Thank you.

  3. #3
    Registered User
    Join Date
    08-09-2016
    Location
    birmingha, england
    MS-Off Ver
    2010
    Posts
    25

    Re: Userform detects entire duplicate row before entering information

    Hi,

    Thanks for your reply.

    I try to enter the code however I always get the error of :


    "End with without with" - I can't seem to figure out where to correct it.

    Thanks

  4. #4
    Forum Guru bakerman2's Avatar
    Join Date
    10-03-2012
    Location
    Antwerp, Belgium
    MS-Off Ver
    MO Prof Plus 2016
    Posts
    6,908

    Re: Userform detects entire duplicate row before entering information

    Should be like this.

    Please Login or Register  to view this content.
    Avoid using Select, Selection and Activate in your code. Use With ... End With instead.
    You can show your appreciation for those that have helped you by clicking the * at the bottom left of any of their posts.

  5. #5
    Registered User
    Join Date
    08-09-2016
    Location
    birmingha, england
    MS-Off Ver
    2010
    Posts
    25

    Re: Userform detects entire duplicate row before entering information

    Thanks to both of you.

    Works perfect.

+ 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. Listbox_Click then List to show entire sheet information in Userform
    By KumarPK in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 01-15-2016, 03:25 AM
  2. Replies: 4
    Last Post: 08-21-2015, 03:59 PM
  3. Macros to delete entire duplicate row for duplicate values
    By cutelebel in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 08-19-2014, 12:09 PM
  4. [SOLVED] Refresh UserForm after entering data in another userform
    By s2jrchoi in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 08-30-2013, 10:34 AM
  5. Replies: 4
    Last Post: 09-18-2012, 09:06 AM
  6. Search column a for duplicate data and copy entire row to duplicate sheet
    By crazyAMP in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 03-20-2012, 08:21 PM
  7. Replies: 8
    Last Post: 05-21-2006, 09:50 PM

Tags for this Thread

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