+ Reply to Thread
Results 1 to 6 of 6

Preventing duplicate row entries

  1. #1
    Registered User
    Join Date
    10-21-2009
    Location
    Vancouver, Canada
    MS-Off Ver
    Excel 2003
    Posts
    5

    Preventing duplicate row entries

    Hello,

    I am looking into creating a macro that would be prevent the entry of duplicate rows of data, within a worksheet. If the input text exists, there should be a warning message, with no option to leave the duplicated item.

    I found the below coding in a different thread. Would it be possible to adjust the below coding to identify duplicate rows of data, from columns A to I? Please let me know if you require more information.

    Thanks,
    Ken

    Code:
    Please Login or Register  to view this content.
    Last edited by Leith Ross; 10-21-2009 at 09:02 PM. Reason: Added Code Tags

  2. #2
    Forum Guru DonkeyOte's Avatar
    Join Date
    10-22-2008
    Location
    Northumberland, UK
    MS-Off Ver
    O365
    Posts
    21,531

    Re: Preventing duplicate row entries

    I guess my instinct (to keep things light-ish) would be to store the concatenation of A:I in another column - say IV ... use this as the basis for duplicate test.

    Please Login or Register  to view this content.
    Does that help ?

    If you avoid the use of IV then the comparison could prove to be quite "expensive" given it will fire on each cell change in A:I range.

  3. #3
    Registered User
    Join Date
    10-21-2009
    Location
    Vancouver, Canada
    MS-Off Ver
    Excel 2003
    Posts
    5

    Re: Preventing duplicate row entries

    Hello,

    Thank you for your assistance. I created the below concatenation formula in column "IV" and copied it down the column. When a new entry row is processed, the concatenation formula will appear in "IV", for that specific row. However, when I process a duplicate row of data, no warning appears. Should I be using a different concatenation formula? Please let me know if you require more information.

    =CONCATENATE(A2,B2,C2,D2,E2,F2,G2,H2,I2)

    Thanks,
    Ken

  4. #4
    Forum Guru DonkeyOte's Avatar
    Join Date
    10-22-2008
    Location
    Northumberland, UK
    MS-Off Ver
    O365
    Posts
    21,531

    Re: Preventing duplicate row entries

    ...I created the below concatenation formula in column "IV" ...
    You don't need to enter anything into Column IV, the VBA Event will do that as and when content of A:I is altered
    (in my post I was merely trying to flag the fact that column IV would be in use)

    ...when I process a duplicate row of data, no warning appears
    check that you have placed the code correctly in VBEditor... it (Worksheet_Change) is a Worksheet level event and thus should reside in the appropriate Worksheet Object... to check that you have done this:

    Right click on the tab against which you wish the code to be applied -> select View Code -> ensure the code provided previously appears in the resulting window (if not paste it into this window). Thereafter you must of course ensure the file is enabled for macros.

  5. #5
    Registered User
    Join Date
    10-21-2009
    Location
    Vancouver, Canada
    MS-Off Ver
    Excel 2003
    Posts
    5

    Re: Preventing duplicate row entries

    Thank you for your help, I have come accross the following problems:

    1) Checking the previously existing data vs newly entered data. It appears that no warning message is shown when a dulplicate row is processed for data that is already existing in the worksheet.

    2) If we enter the information via the form module, could the check be applied to the newly entered data.

    3) If duplicate infromation is processed, could the entire row be deleted, instead of the most recent cell entered

    4) Could column F not be included in the check. Thus, the check should be only applied to columns A to E and G to I.

    Thanks,
    Ken

  6. #6
    Registered User
    Join Date
    10-21-2009
    Location
    Vancouver, Canada
    MS-Off Ver
    Excel 2003
    Posts
    5

    Re: Preventing duplicate row entries

    Hello,

    Can anyone help with this one?

    Your assistance is greatly appreciated.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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