+ Reply to Thread
Results 1 to 3 of 3

Code to search for duplicate and pop up message asking for different value

  1. #1
    Registered User
    Join Date
    01-09-2012
    Location
    Thetford, England
    MS-Off Ver
    Excel 2003
    Posts
    21

    Code to search for duplicate and pop up message asking for different value

    Hi everyone,

    I need a piece of code that can be added to a macro I have written for a "save button" which when pressed checks the contents of cell C15 on sheet 1 of my workbook against all values in column A on sheet 7 for a duplicate and if it finds one shows a pop-up box asking the user to enter a different value to avoid having multiple items with the same reference number.

    Thanks in advance,

    Glen
    Last edited by Glensafro; 03-12-2012 at 12:31 PM.

  2. #2
    Forum Expert tigeravatar's Avatar
    Join Date
    03-25-2011
    Location
    Colorado, USA
    MS-Off Ver
    Excel 2003 - 2013
    Posts
    5,361

    Re: Code to search for duplicate and pop up message asking for different value

    Glen,

    Give this a try:
    Please Login or Register  to view this content.
    Hope that helps,
    ~tigeravatar

    Forum Rules: How to use code tags, mark a thread solved, and keep yourself out of trouble

  3. #3
    Registered User
    Join Date
    01-09-2012
    Location
    Thetford, England
    MS-Off Ver
    Excel 2003
    Posts
    21

    Re: Code to search for duplicate and pop up message asking for different value

    That's great thanks Tiger. Just a note incase anyone else reads this, the actual code I used was the one below. I had to tweek the cell references slightly because my sheets aren't actually called sheet 1 and sheet 7, but that is their reference in the VBA window.

    Please Login or Register  to view this content.
    Thanks again!

+ 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