+ Reply to Thread
Results 1 to 6 of 6

Prevent Duplicate Entries From UserForm TextBox

  1. #1
    Forum Contributor
    Join Date
    03-14-2015
    Location
    Mexico
    MS-Off Ver
    365
    Posts
    279

    Prevent Duplicate Entries From UserForm TextBox

    Hi I have the attached code that I found in internet however I has not been able to get it work.

    Basically I want to enter data to sheet Customers using VBA (Userform). The rule is that if the customer Id already exists, inform the user and clear the Textbox so they can enter a new valid customer id.

    Thanks,
    Attached Files Attached Files

  2. #2
    Forum Guru :) Sixthsense :)'s Avatar
    Join Date
    01-01-2012
    Location
    India>Tamilnadu>Chennai
    MS-Off Ver
    2003 To 2010
    Posts
    12,770

    Re: Prevent Duplicate Entries From UserForm TextBox

    Check the attached file
    Attached Files Attached Files


    If your problem is solved, then please mark the thread as SOLVED>>Above your first post>>Thread Tools>>
    Mark your thread as Solved


    If the suggestion helps you, then Click *below to Add Reputation

  3. #3
    Forum Contributor
    Join Date
    03-14-2015
    Location
    Mexico
    MS-Off Ver
    365
    Posts
    279

    Re: Prevent Duplicate Entries From UserForm TextBox

    Thank you Sixthsense, It is not working. Once I enter a new item, I get the message "Customer ID Created Successfully" however when I close the UserForm the other message "Customer already exists" comes up, and the new customer Id is not listed.

    Can you please check if something wrong in the code?

    Thank you!

  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: Prevent Duplicate Entries From UserForm TextBox

    Remove the AfterUpdate sub and only use 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
    Forum Contributor
    Join Date
    03-14-2015
    Location
    Mexico
    MS-Off Ver
    365
    Posts
    279

    Re: Prevent Duplicate Entries From UserForm TextBox

    Thank you Bakerman2, that worked great.

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

    Re: Prevent Duplicate Entries From UserForm TextBox

    Glad to help and thanks for rep+.

+ 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. [SOLVED] Prevent Duplicate Entries in Excel Worksheet While Transferring Data from UserForm
    By rakotonirinas in forum Excel Programming / VBA / Macros
    Replies: 32
    Last Post: 11-23-2018, 07:24 PM
  2. [SOLVED] Prevent Duplicate Entries when Editing Data using Userform
    By farhadj in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 05-05-2017, 01:05 PM
  3. [SOLVED] Prevent duplicate entries
    By Blokeman in forum Excel Programming / VBA / Macros
    Replies: 14
    Last Post: 11-06-2015, 07:24 PM
  4. [SOLVED] Prevent Duplicate entries in multiple column from VBA Userform
    By excel_126 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 12-18-2014, 03:13 AM
  5. Replies: 0
    Last Post: 06-14-2012, 12:38 PM
  6. Prevent Duplicate Entries
    By whousedmy in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 08-17-2010, 11:40 AM
  7. Prevent Duplicate Entries
    By luckyphil in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 06-07-2007, 08:20 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