+ Reply to Thread
Results 1 to 3 of 3

Prevent Duplicate entries in multiple column from VBA Userform

  1. #1
    Registered User
    Join Date
    07-10-2014
    Location
    India
    MS-Off Ver
    2013
    Posts
    33

    Prevent Duplicate entries in multiple column from VBA Userform

    Dear Team,

    I have a vba userform which enters data into multiple sheets. For two comboboxes, there can be "X" combinations like as follows:

    Column B Column C
    John Red
    John Black
    Michael Red
    Michael Black

    I want to prevent duplicate entries into columns. Currently I am using following code but it doesn't allow me to add multiple combinations. e.g. It won't allow me to add "Michael Red" if I have added "John Red" earlier in sheet.

    Please Login or Register  to view this content.
    Please help for this query.
    Last edited by excel_126; 12-17-2014 at 03:08 AM.

  2. #2
    Valued Forum Contributor natefarm's Avatar
    Join Date
    04-22-2010
    Location
    Wichita, Kansas
    MS-Off Ver
    2016
    Posts
    1,020

    Re: Prevent Duplicate entries in multiple column from VBA Userform

    Would it be possible to have another column, maybe hidden, with a formula that combined the B and C values, and then compare your entries with that? So your formula in G2 would be
    Formula: copy to clipboard
    Please Login or Register  to view this content.

    and your code would be
    Please Login or Register  to view this content.
    Acts 4:12
    Salvation is found in no one else, for there is no other name under heaven given to mankind by which we must be saved.

  3. #3
    Registered User
    Join Date
    07-10-2014
    Location
    India
    MS-Off Ver
    2013
    Posts
    33

    Re: Prevent Duplicate entries in multiple column from VBA Userform

    Dear Natefarm,

    Many thanks for your reply.

    Sorry, I can't have hidden column. But I changed the code from

    Please Login or Register  to view this content.
    And It solved the problem.

    Many Thanks & Kind Regards

+ 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. Prevent duplicate entry in a userform by matching record to multiple columns.
    By rsbuslon in forum Excel Programming / VBA / Macros
    Replies: 9
    Last Post: 01-05-2023, 07:44 PM
  2. How To Prevent Duplicate URL Entries in the Cell in a Column?
    By kalucharan in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 03-23-2014, 03:54 AM
  3. Need a real time macro to prevent the duplicate entries between multiple worksheets
    By Manish_Gupta in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 11-26-2013, 07:07 AM
  4. Replies: 0
    Last Post: 06-14-2012, 12:38 PM
  5. [SOLVED] Prevent duplicate entries
    By Teri in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 03-03-2005, 10:06 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