+ Reply to Thread
Results 1 to 3 of 3

search a range and return a value from another range without using arrays

  1. #1
    Registered User
    Join Date
    12-14-2009
    Location
    Utrecht, NL
    MS-Off Ver
    Excel 2003
    Posts
    1

    search a range and return a value from another range without using arrays

    i'm looking for some help with this vba function. I want to make a lookup function that compares the value in a searchfield to the value of a range and returns a partial match.
    for example, if I have a range that contains the word october it would return that word if I search for oct

    The function I have works. However it is pretty slow when applied to large ranges. I've converted all my ranges to arrays and used those to search. I think solving the function without arrays should speed it up considerably.
    can anyone help me with the following two problems:

    * How can I change this function to work without having to convert my ranges to arrays first
    * How do I get this function to work with an entire column


    Please Login or Register  to view this content.
    Last edited by marcwagner; 12-14-2009 at 05:53 AM. Reason: conforming to mod request

  2. #2
    Forum Expert royUK's Avatar
    Join Date
    11-18-2003
    Location
    Derbyshire,UK
    MS-Off Ver
    Xp; 2007; 2010
    Posts
    26,200

    Re: Help me tweak this formula

    Your post does not comply with Rule 1 of our Forum RULES. Your post title should accurately and concisely describe your problem, not your anticipated solution. Use terms appropriate to a Google search. Poor thread titles, like Please Help, Urgent, Need Help, Formula Problem, Code Problem, and Need Advice will be addressed according to the OP's experience in the forum: If you have less than 10 posts, expect (and respond to) a request to change your thread title. If you have 10 or more posts, expect your post to be locked, so you can start a new thread with an appropriate title.
    To change a Title on your post, click EDIT then Go Advanced and change your title, if 2 days have passed ask a moderator to do it for you.
    Hope that helps.

    RoyUK
    --------
    For Excel Tips & Solutions, free examples and tutorials why not check out my web site

    Free DataBaseForm example

  3. #3
    Valued Forum Contributor
    Join Date
    08-26-2006
    Location
    -
    MS-Off Ver
    2010
    Posts
    388

    re: search a range and return a value from another range without using arrays

    Hi,

    No need to re-invent the wheel, use the Find method (Range object).
    For a partial match set the LookAt argument to xlPart.

+ 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