Results 1 to 7 of 7

Prevent Duplicate Entries when Editing Data using Userform

Threaded View

farhadj Prevent Duplicate Entries... 05-01-2017, 03:56 PM
mehmetcik Re: Prevent Duplicate Entries... 05-01-2017, 05:47 PM
farhadj Re: Prevent Duplicate Entries... 05-03-2017, 05:12 PM
bakerman2 Re: Prevent Duplicate Entries... 05-03-2017, 08:45 PM
mehmetcik Re: Prevent Duplicate Entries... 05-04-2017, 12:44 PM
bakerman2 Re: Prevent Duplicate Entries... 05-04-2017, 08:48 PM
mehmetcik Re: Prevent Duplicate Entries... 05-05-2017, 01:05 PM
  1. #4
    Forum Guru bakerman2's Avatar
    Join Date
    10-03-2012
    Location
    Antwerp, Belgium
    MS-Off Ver
    MSO Home and Business 2024
    Posts
    7,273

    Re: Prevent Duplicate Entries when Editing Data using Userform

    Private Sub txtTag_Change()  'Add DBN Prefix
        Static abort As Boolean
        If abort Then abort = False: Exit Sub
        With txtTag
              If Not .Text Like "DBN*" And .Text <> vbNullString Then
                abort = True
                .Text = "DBN" & .Text
            End If
        End With
        
        If Not IsError(Application.Match(txtTag.Text, Columns(10), 0)) Then
            MsgBox "Duplicate Entry", vbOKOnly
            txtTag = vbNullString
        End If
    End Sub
    Last edited by bakerman2; 05-04-2017 at 01:33 AM.
    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.

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 multiple column from VBA Userform
    By excel_126 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 12-18-2014, 03:13 AM
  2. Prevent duplicate entries in Data Validation List By code
    By YasserKhalil in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 10-26-2014, 04:56 PM
  3. Prevent duplicate entries in Data Validation List By code
    By YasserKhalil in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 10-26-2014, 04:37 PM
  4. Replies: 0
    Last Post: 06-14-2012, 12:38 PM
  5. Prevent Duplicate Entries
    By whousedmy in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 08-17-2010, 11:40 AM
  6. To prevent duplicate entries using Data validation.
    By legendkiller420 in forum Excel General
    Replies: 3
    Last Post: 07-09-2010, 07:47 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