+ Reply to Thread
Results 1 to 6 of 6

how to optimize finding matching values macro speed

  1. #1
    Forum Contributor
    Join Date
    08-08-2012
    Location
    london
    MS-Off Ver
    Excel 2010
    Posts
    196

    how to optimize finding matching values macro speed

    Dear all,

    I am writing to seek help in optimizing the following macro below, as is freezes and displays the out put after 10/15 minutes.

    I have posted a same thread on the following forum below but did not get any response:

    http://www.mrexcel.com/forum/excel-q...tch-value.html

    Please Login or Register  to view this content.

    Thank you for your time and help.
    Last edited by missy22; 09-25-2013 at 10:45 AM.

  2. #2
    Registered User
    Join Date
    01-28-2013
    Location
    Manchester, England
    MS-Off Ver
    Excel 2003, Excel 2007, Excel 2010
    Posts
    50

    Re: how to optimize finding matching values macro speed

    As far as I can tell, you have a bunch of data in Sheet2 range G1 to H?.
    You want to look up preferably the value in H if it's there against sheet1 column C or if column G is populated then look up against Sheet1 column B?
    The lookup value gives a corresponding row number for Sheet1 column A to be logged back in sheet2 column I.

    Is my above understanding of what you're trying to achieve correct?

    Firstly, on sheet1, can column A be moved to column D? If so, then you could do all of this with a worksheet formula I think.

    If you need to do it with VBA code, then there a couple of ways to speed up your code execution, like loading Sheet1 contents into a second array rather than continuously reading from the worksheet.
    Is it possible to upload a copy of the workbook?
    Please consider the * button if my post helped you

  3. #3
    Forum Contributor
    Join Date
    08-08-2012
    Location
    london
    MS-Off Ver
    Excel 2010
    Posts
    196

    Re: how to optimize finding matching values macro speed

    Thank you so much for your response.

    As far as I can tell, you have a bunch of data in Sheet2 range G1 to H?.
    You want to look up preferably the value in H if it's there against sheet1 column C or if column G is populated then look up against Sheet1 column B?
    The lookup value gives a corresponding row number for Sheet1 column A to be logged back in sheet2 column I.

    Is my above understanding of what you're trying to achieve correct?
    This is correct. if possible, i would like the solution in a macro as I have 130000 lines of data. I have attached the actual data with the code behind worksheet 1, as requested.

    https://app.box.com/s/wuih2dot2vg19cqe79b4

    Thank you so much for your help and time.

  4. #4
    Forum Contributor
    Join Date
    08-08-2012
    Location
    london
    MS-Off Ver
    Excel 2010
    Posts
    196

    Re: how to optimize finding matching values macro speed

    Dear all,

    If anyone could provide some guidance or help, would be very much appreciated. Thank you for your time and help.

  5. #5
    Forum Contributor
    Join Date
    08-08-2012
    Location
    london
    MS-Off Ver
    Excel 2010
    Posts
    196

    Re: how to optimize finding matching values macro speed

    dear all,

    I am writing to seek help on creating a macro with the following logic below:

    for example:
    Sheet 1 input data - column A(Name), B(ID) and C (Lng_iD)

    Sheet1.jpg

    Sheet2 input data - Column G(ID) and H(lng_id):

    Sheet2.jpg

    Desired output after the macro has run in Sheet 2 - column I

    Sheet2_desiredOuput.jpg



    Please note: There are blank rows in between two datasets and the actual dataset can be viewed from post 3. The actual data has 130,000 lines of data, and if possible, could the macro processing time be under two minute or less.


    Any help would be appreciated.
    Thank you
    Last edited by missy22; 09-25-2013 at 10:46 AM.

  6. #6
    Forum Contributor
    Join Date
    08-08-2012
    Location
    london
    MS-Off Ver
    Excel 2010
    Posts
    196

    Re: how to optimize finding matching values macro speed

    I have attached a example workbook below for clearer explanation.

    example_test.xls

    Thank you.

+ 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. [SOLVED] Finding matching values from different columns
    By hefe_espada in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 06-23-2013, 07:24 PM
  2. [SOLVED] Finding Duplicate and Matching Values in Rows
    By fitkhan in forum Excel General
    Replies: 2
    Last Post: 04-05-2012, 09:07 PM
  3. Finding the Lowest Values and Matching
    By artiststevens in forum Excel General
    Replies: 1
    Last Post: 05-04-2011, 11:45 PM
  4. Replies: 1
    Last Post: 04-02-2011, 06:39 AM
  5. Finding Matching values in cells
    By Zemmy in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 10-26-2008, 04:09 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