+ Reply to Thread
Results 1 to 8 of 8

Search for values and return true or false value

  1. #1
    Registered User
    Join Date
    08-15-2013
    Location
    london
    MS-Off Ver
    Excel 2003
    Posts
    7

    Search for values and return true or false value

    Hi,

    I would like some help to produce some vba code to perform the following action:

    1)search sheet 1 for 300 numeric values that are listed in column A sheet 2

    2)Each value in column A sheet 2, if found in sheet sheet 1, should return a True or False value in Column B sheet 2.

    (please note the values may occur more than once in sheet one)

    I hope this is clear. Any questions please ask.


    Thanks in advanced for any help.

  2. #2
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    52,936

    Re: Search for values and return true or false value

    Hi, welcome to the forum

    Not sure you need VBA for this, something like COUNTIF() or MATCH() would probably do what you want. Can you upload a small (clean) sample workbook (not a pic) of what you are working with, and what your expected outcome would look like.
    1. Use code tags for VBA. [code] Your Code [/code] (or use the # button)
    2. If your question is resolved, mark it SOLVED using the thread tools
    3. Click on the star if you think someone helped you

    Regards
    Ford

  3. #3
    Forum Expert
    Join Date
    06-12-2012
    Location
    Ridgefield Park, New Jersey
    MS-Off Ver
    Excel 2003,2007,2010
    Posts
    10,241

    Re: Search for values and return true or false value

    Maybe:

    Please Login or Register  to view this content.

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

    Re: Search for values and return true or false value

    You didn't state if the values in sheet 1 are in column A or could be anywhere on the sheet. If the latter, then try:
    Please Login or Register  to view this content.
    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.

  5. #5
    Registered User
    Join Date
    08-15-2013
    Location
    london
    MS-Off Ver
    Excel 2003
    Posts
    7

    Re: Search for values and return true or false value

    Quote Originally Posted by Mumps1 View Post
    You didn't state if the values in sheet 1 are in column A or could be anywhere on the sheet. If the latter, then try:
    Please Login or Register  to view this content.
    Amazing response guys! Really helpful.

    i have gone with the code above as the data can indeed appear anywhere in sheet1.

    However, i now have an issue in that the cells that contain the values i am searching for also contain other text.

    for example, cell A1 contains:

    BOW PIONE 9990148.001 *4013860 REFOR F/P 680 000.000M F 00.01 0000001.000 VAS AROMS c_IPBrent Jan15 Close +00.0 Dec12-15 00.000B F 0.000 0.00 (608.54)R


    so, is it possible for the search to pick the specific value from each cell, for example, "9990148.001" from the above example?

    thanks in advance

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

    Re: Search for values and return true or false value

    Just change xlWhole to xlPart.

  7. #7
    Registered User
    Join Date
    08-15-2013
    Location
    london
    MS-Off Ver
    Excel 2003
    Posts
    7

    Re: Search for values and return true or false value

    Quote Originally Posted by Mumps1 View Post
    Just change xlWhole to xlPart.
    Brilliant! thanks again for everyone's help!

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

    Re: Search for values and return true or false value

    Glad it worked out.

+ 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. Function to search Column for a range of values and return TRUE or FALSE
    By BamBamMoneyBags in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 02-05-2013, 05:59 AM
  2. Replies: 2
    Last Post: 02-17-2011, 10:15 PM
  3. [SOLVED] Search for 2 true arguments and return true or false
    By David in forum Excel General
    Replies: 3
    Last Post: 07-15-2006, 05:20 AM
  4. Search column for value and return TRUE or FALSE
    By Remote Desktop Connection hotkey in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 09-06-2005, 03:05 AM
  5. [SOLVED] Search column for value and return TRUE or FALSE
    By Remote Desktop Connection hotkey in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 09-05-2005, 10:05 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