+ Reply to Thread
Results 1 to 9 of 9

How can I get exact returns in my search?

  1. #1
    Registered User
    Join Date
    08-13-2014
    Location
    Australia
    MS-Off Ver
    365
    Posts
    25

    How can I get exact returns in my search?

    I have a worksheet that has a filter applied to each column. I then use a macro to extract data from that sheet. Part of the macto will copy a name from a cell on another sheet, filter the name column and then copy a select number of records. To do this, the macro uses the filter on the name column, uses the "text filter = NAME" to filter the column.

    My problem is that, if the search cell is FRED, the macro will return results with FRED, FREDDY, FREDERICK, etc. Basically, anything that starts with FRED.

    I tried putting "" around the search cell (eg "FRED") but this didnt work.

    Is there a way, using my existing macro that I can make it only find the exact match. The macro is very complicated, but hoping that I could either modify data in the search ceill or go in and edit the macro to make it find only exact match.

    Many thanks

  2. #2
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    37,376

    Re: How can I get exact returns in my search?

    How would you have us suggest amendments to your code if you're not going to share it with us?

    And a sample workbook would facilitate testing ...

  3. #3
    Registered User
    Join Date
    08-13-2014
    Location
    Australia
    MS-Off Ver
    365
    Posts
    25

    Re: How can I get exact returns in my search?

    Quote Originally Posted by TMS View Post
    How would you have us suggest amendments to your code if you're not going to share it with us?

    And a sample workbook would facilitate testing ...
    The workbooks involve over a million rows of data and the combined books are more than 140Mb in size. I was hoping there was an obvious way to make Excel only find axact match when using the text filter = function.

  4. #4
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 2000/3/7/10/13/16/365
    Posts
    52,123

    Re: How can I get exact returns in my search?

    Maybe use the LEN() function to ensure it only searches for x-number of chars?
    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

  5. #5
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    37,376

    Re: How can I get exact returns in my search?

    I was hoping there was an obvious way to make Excel only find axact match when using the text filter = function.
    There may well be but, unlike Ford, I won't be playing 20 Questions to second guess what needs doing.

    You don't need the 140 Mb workbooks (bet that's quick), just a representative sample of non sensitive data.

  6. #6
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 2000/3/7/10/13/16/365
    Posts
    52,123

    Re: How can I get exact returns in my search?

    @ Trevor - I agree, and I wasnt playing 20 questions, just have a single stab

  7. #7
    Forum Guru sktneer's Avatar
    Join Date
    04-30-2011
    Location
    Kanpur, India
    MS-Off Ver
    Office 365
    Posts
    9,639

    Re: How can I get exact returns in my search?

    See if you can apply this logic to your current code.
    Attached Files Attached Files
    Last edited by sktneer; 09-16-2014 at 01:22 AM.
    Regards
    sktneer


    Treat people the way you want to be treated. Talk to people the way you want to be talked to.
    Respect is earned NOT given.

  8. #8
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    37,376

    Re: How can I get exact returns in my search?

    I am sorry if I have offended you, which I clearly have.

    More often than not, if an OP is reluctant to provide a sample workbook, the thread can take a lot longer to resolve, as trial and error solutions are rejected. It can generate a large number of inconclusive posts. Conversely, if a sample workbook with typical data and the current code is uploaded at the outset, a speedy and effective answer is more likely.

    Hence my reason for saying that I don't want to play 20 questions. Perhaps I could have phrased that better. Again, apologies for that.

    It seems that you have initiated 8 threads in this forum, 4 of which have been marked solved, 1 that was answered but not marked solved, 2 that were moderated, and the current thread. None of them appear to relate to improving performance, speed or efficiency. But maybe they are.

    Whatever, I hope someone will be able to offer you a solution. Given the impression you have formed of me, it is probably better if I drop out now. Good luck.

    Regards, TMS

  9. #9
    Administrator JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: How can I get exact returns in my search?

    @Blogger,

    TMS is right. Any requests by someone offering to help here, for free, should be respected. The commentary between TMS and Richard reads playful and still trying to be helpful. No matter what you think you're reading, everyone here is actually trying to help and teach and make things occur quickly and simply.

    I've removed your post above because you truly misread the situation and I don't think it needs to be here for the topic to be pursued to a positive conclusion.

    TIP OF THE DAY - the moment you start to type a response that is not on the topic but is rather a comment on the PERSON of a prior post, you're typing a losing post. Don't do it. Just respond to the topic. If you're not going to provide something someone has asked for, even if you think it's dumb, just say "Thanks".
    Last edited by JBeaucaire; 09-19-2014 at 12:22 PM.

+ 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. lookup exact match returns TRUE or FALSE
    By quade_1 in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 11-05-2016, 02:21 AM
  2. [SOLVED] 'IF vlookup returns exact match, then activate and select from a 'list'
    By andrew@ilguk.com in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 05-08-2013, 09:25 AM
  3. [SOLVED] Vlookup formula returns with False Result, How can I get the exact value ?
    By Midoya in forum Excel Formulas & Functions
    Replies: 20
    Last Post: 02-21-2013, 04:34 AM
  4. Search Multiple Worksheets Against List of Non-Exact Search Criteria?
    By thump4r in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 12-17-2010, 03:46 PM
  5. [SOLVED] Lookup returns message box when an exact match is not found
    By JFeeman in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 02-11-2005, 04:06 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