+ Reply to Thread
Results 1 to 2 of 2

Check if value exists in a range, if not add it to that range.Thank you!

  1. #1
    Registered User
    Join Date
    07-10-2014
    Location
    Japan
    MS-Off Ver
    2013
    Posts
    10

    Check if value exists in a range, if not add it to that range.Thank you!

    Hi everybody,

    I am trying to create a macro to check if the entered username exists in a range. The range are set up as all "A" column in the worksheet called "UserName"

    I will start with asking " enter a name" in a userform and then I need to check if this name already exist in the range. If not exist in the range, it will return to the message box "congratulation!" and also the new username will be added into that range, if yes, it will return to the message box "please enter another name.."

    After reading some other posts, I am a little confused how to do it. Match function? or Countif ? or LookUp?

    I am very thankful for any help.

    Thank you!

  2. #2
    Forum Expert
    Join Date
    07-31-2010
    Location
    California
    MS-Off Ver
    Excel 2007
    Posts
    4,070

    Re: Check if value exists in a range, if not add it to that range.Thank you!

    Either match or find. Match is a little better I believe. Here is example of both:

    Please Login or Register  to view this content.

+ 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. Check if a named range exists
    By Hein in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 07-14-2010, 09:16 AM
  2. Check if Value Exists in Range For Worksheet Filtering
    By DGA2008 in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 11-03-2009, 12:03 PM
  3. How to check if range exists
    By z0rpia in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 01-14-2009, 12:15 AM
  4. [SOLVED] Check if named range exists!
    By steve_doc in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 04-29-2006, 07:00 PM
  5. Check if a number exists in a range?
    By gkaste in forum Excel General
    Replies: 2
    Last Post: 07-13-2005, 03:00 PM

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