Results 1 to 7 of 7

Duplicate entries

Threaded View

  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


    Private Sub TextBox22_Exit(ByVal Cancel As MSForms.ReturnBoolean)
        FindString = TextBox22.Value
        If Trim(FindString) <> "" Then
            With Sheets("2009").Range("A:A")
                Set Rng = .Find(What:=FindString, _
                                After:=.Cells(.Cells.Count), _
                                LookIn:=xlValues, _
                                LookAt:=xlWhole, _
                                SearchOrder:=xlByRows, _
                                SearchDirection:=xlNext, _
                                MatchCase:=False)
                If Not Rng Is Nothing Then
                    MsgBox "Duplicate Found - Change Name"
                    TextBox22.Value = ""
                                Else
                End If
            End With
        End If
    End Sub
    Last edited by Streng; 03-09-2009 at 03:31 PM.

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