+ Reply to Thread
Results 1 to 6 of 6

Duplicate Check :: Text Box Input to Compare with Excel Sheet Content

  1. #1
    Registered User
    Join Date
    01-11-2015
    Location
    India
    MS-Off Ver
    2010
    Posts
    19

    Question Duplicate Check :: Text Box Input to Compare with Excel Sheet Content

    Hi All,

    I created a user-form to enter product ID in textbox1. Product ID is unique. There is list of product ID that is already entered in the sheet1 from A2 to A20. I just want to know how to throw a hard-stop vbcritical error if user tries to enter the product ID in the text box which is already available in the range A2:A20.

    Any help would be appreciated.

    Thanks in advance.

    Regards,
    Dheepak

  2. #2
    Forum Expert Mumps1's Avatar
    Join Date
    10-10-2012
    Location
    Toronto, Canada
    MS-Off Ver
    Excel 2010, 2013
    Posts
    7,775

    Re: Duplicate Check :: Text Box Input to Compare with Excel Sheet Content

    Insert a command button in your userform and assign this code to it:
    Please Login or Register  to view this content.
    Last edited by Mumps1; 10-31-2015 at 09:14 AM.
    You can say "THANK YOU" for help received by clicking the Star symbol at the bottom left of the helper's post.
    Practice makes perfect. I'm very far from perfect so I'm still practising.

  3. #3
    Forum Expert gmr4evr1's Avatar
    Join Date
    11-24-2014
    Location
    Texas
    MS-Off Ver
    Office 2010 and 2007
    Posts
    3,448

    Re: Duplicate Check :: Text Box Input to Compare with Excel Sheet Content

    Add ,vbCritical at the end of the MsgBox line for the critical stop.
    Last edited by gmr4evr1; 10-31-2015 at 09:50 AM. Reason: corrected typo
    1N73LL1G3NC3 15 7H3 4B1L17Y 70 4D4P7 70 CH4NG3 - 573PH3N H4WK1NG
    You don't have to add Rep if I have helped you out (but it would be nice), but please mark the thread as SOLVED if your issue is resolved.

    Tom

  4. #4
    Registered User
    Join Date
    01-11-2015
    Location
    India
    MS-Off Ver
    2010
    Posts
    19

    Re: Duplicate Check :: Text Box Input to Compare with Excel Sheet Content

    Thank you so much for the help Mumps1 & gmr4evr1.

  5. #5
    Forum Expert Mumps1's Avatar
    Join Date
    10-10-2012
    Location
    Toronto, Canada
    MS-Off Ver
    Excel 2010, 2013
    Posts
    7,775

    Re: Duplicate Check :: Text Box Input to Compare with Excel Sheet Content

    Glad to help.

  6. #6
    Forum Expert gmr4evr1's Avatar
    Join Date
    11-24-2014
    Location
    Texas
    MS-Off Ver
    Office 2010 and 2007
    Posts
    3,448

    Re: Duplicate Check :: Text Box Input to Compare with Excel Sheet Content

    You're welcome.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Replies: 4
    Last Post: 08-21-2015, 03:59 PM
  2. [SOLVED] VBA to check values from one sheet and copy only content to another sheet
    By skipperfoto in forum Excel Programming / VBA / Macros
    Replies: 10
    Last Post: 02-27-2014, 12:46 PM
  3. Check if row is duplicate before adding to excel sheet
    By sdemps in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 09-20-2013, 04:47 PM
  4. Check duplicate then compare latest version then give a value
    By henkdevreisch in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 02-06-2013, 07:23 AM
  5. How to compare content of two excel sheet ???
    By etienneb in forum Excel General
    Replies: 3
    Last Post: 06-22-2012, 09:49 AM
  6. Check to see if input box content is uppercase
    By phschris1 in forum Excel Programming / VBA / Macros
    Replies: 12
    Last Post: 10-11-2011, 02:23 PM
  7. Replies: 1
    Last Post: 07-22-2005, 02:05 AM

Tags for this Thread

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