+ Reply to Thread
Results 1 to 3 of 3

Find.range to return True if match occurs

  1. #1
    Registered User
    Join Date
    10-11-2012
    Location
    switzerland
    MS-Off Ver
    Excel 2010
    Posts
    38

    Find.range to return True if match occurs

    Hey

    I need to get a value from a cell and check wheter it exists in a range.

    Right now I have:

    Please Login or Register  to view this content.
    This doesn't work as I wanted. Also, I think it is very slow.

    I'd like to achieve something in the way:

    Please Login or Register  to view this content.
    Where the function would be something like:

    Please Login or Register  to view this content.
    Now, I am very new to VBA, so my questions are:

    - Can I have a Range.find function which returns True if a match occurs?

    Why do I want that? Well, looping through the cells is very slow (I'd like the code to be as fast as possible) and using Application.Functions doesn't seem right to me, especially because I read that they aren't fast either.

    Thx
    Last edited by nivoe; 11-15-2012 at 07:35 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: Find.range to return True if match occurs

    I recommend using the excel formula Countif
    If you need it in VBA, use Worksheetfunction.Countif
    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
    10-11-2012
    Location
    switzerland
    MS-Off Ver
    Excel 2010
    Posts
    38

    Re: Find.range to return True if match occurs

    Yeah, works perfectly ... and fast so far let's see how it will be with 3000 rows.

    Thank you very much

+ 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