+ Reply to Thread
Results 1 to 7 of 7

Duplicate entries

  1. #1
    Registered User
    Join Date
    08-28-2008
    Location
    bournemouth
    MS-Off Ver
    Office 2007
    Posts
    42

    Duplicate entries

    I have a piece of code shown below.
    I need to change it slightly but need help to do it.
    I need it to display the message if findstring has been found more than once (i.e Twice)
    Hope someone can help


    Please Login or Register  to view this content.
    Last edited by Streng; 03-09-2009 at 03:31 PM.

  2. #2
    Valued Forum Contributor blane245's Avatar
    Join Date
    02-20-2009
    Location
    Melbourne, FL
    MS-Off Ver
    Excel 2010
    Posts
    649

    Re: Duplicate entries

    If you test Rng.Count=2 that should do the trick. If the find can be anything greater than 1 occurrence, the Rng.Count>=1 wil work as a test.

  3. #3
    Forum Expert royUK's Avatar
    Join Date
    11-18-2003
    Location
    Derbyshire,UK
    MS-Off Ver
    Xp; 2007; 2010
    Posts
    26,200

    Re: Duplicate entries

    It looks like your code currently searches for an entry in a textbox and displays a message if that entry already exists in Column A. Is that not what you are asking for?
    Hope that helps.

    RoyUK
    --------
    For Excel Tips & Solutions, free examples and tutorials why not check out my web site

    Free DataBaseForm example

  4. #4
    Registered User
    Join Date
    08-28-2008
    Location
    bournemouth
    MS-Off Ver
    Office 2007
    Posts
    42

    Re: Duplicate entries

    Thanks for reply

    The routine is for a textbox exit, it is correct that this displays a message if the entry already exists already in column A.

    But, i would like this message to come up if the entry in the textbox exists twice in column A.

  5. #5
    Forum Moderator Leith Ross's Avatar
    Join Date
    01-15-2005
    Location
    San Francisco, Ca
    MS-Off Ver
    2000, 2003, & 2010
    Posts
    23,258

    Re: Duplicate entries

    Hello Streng,

    The code will now display the dialog if there is more than one occurrence of the TextBox value.
    Please Login or Register  to view this content.
    Sincerely,
    Leith Ross

    Remember To Do the Following....

    1. Use code tags. Place [CODE] before the first line of code and [/CODE] after the last line of code.
    2. Thank those who have helped you by clicking the Star below the post.
    3. Please mark your post [SOLVED] if it has been answered satisfactorily.


    Old Scottish Proverb...
    Luathaid gu deanamh maille! (Rushing causes delays!)

  6. #6
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2003, 2010
    Posts
    40,678

    Re: Duplicate entries

    Or perhaps ...
    Please Login or Register  to view this content.
    Entia non sunt multiplicanda sine necessitate

  7. #7
    Registered User
    Join Date
    08-28-2008
    Location
    bournemouth
    MS-Off Ver
    Office 2007
    Posts
    42

    Re: Duplicate entries

    Sorted thanks very much for help,
    How do you make the thread 'SOLVED' or is that up to someone else

+ 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