+ Reply to Thread
Results 1 to 8 of 8

Search efficiency

  1. #1
    Registered User
    Join Date
    05-24-2010
    Location
    Rutherfordton, NC
    MS-Off Ver
    Excel 2007
    Posts
    39

    Question Search efficiency

    I am running a fairly large block of code on quite a lot of data(4 to 5 thousand lines x several columns).

    I have two criteria:

    "wsApt.Cells(lRow, 2) and wsApt.Cells(lRow, 5).Value" need to match when looking through a sheet with thousands of lines. Upon finding a match, the value of a certain cell(wsReadings.Cells(rReadings.Row, 6)) should be pasted into wsApt.Cells(lRow, 6). This might be a little hard to follow, so I have attached the code.

    Please Login or Register  to view this content.

    Any input would be greatly appreciated. Sorry if I am not clear enough, I'll try to help you understand. Thanks in advance.
    Jordan Kidd

  2. #2
    Registered User
    Join Date
    05-24-2010
    Location
    Rutherfordton, NC
    MS-Off Ver
    Excel 2007
    Posts
    39

    Re: Search efficiency

    Bump no response.

  3. #3
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2003, 2010
    Posts
    40,678

    Re: Search efficiency

    You haven't said what the problem is, or what happens when you step through the code.
    Entia non sunt multiplicanda sine necessitate

  4. #4
    Registered User
    Join Date
    05-24-2010
    Location
    Rutherfordton, NC
    MS-Off Ver
    Excel 2007
    Posts
    39

    Re: Search efficiency

    So sorry about that.Maybe I should go down in history as one of the most bothersome users of this forum(which is really super), but I hope not. I got way too busy in the office here doing about five things at once and forgot to ask the question.

    My question is, how can I do this more efficiently? Also, searching simultaneously for both criteria is not working in the code I have shown. I only get any result when I comment one of the criteria out, which doesn't really solve my problem.

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

    Re: Search efficiency

    We like to have the whole picture wherever possible. We can help suggest corrections to existing code if it's basic and clear in the query, yours really isn't.

    For your situation, it would simpler for us if you simply upload a sample workbook showing the data and mockup of your desired results. Your existing code in the workbook is a plus, but if you show us quickly what you have for data and what you want for criteria selection and results, we can offer more exacting suggestions.

    Click GO ADVANCED and use the paperclip icon to upload a desensitized copy of your workbook.
    _________________
    Microsoft MVP 2010 - Excel
    Visit: Jerry Beaucaire's Excel Files & Macros

    If you've been given good help, use the icon below to give reputation feedback, it is appreciated.
    Always put your code between code tags. [CODE] your code here [/CODE]

    ?None of us is as good as all of us? - Ray Kroc
    ?Actually, I *am* a rocket scientist.? - JB (little ones count!)

  6. #6
    Registered User
    Join Date
    05-24-2010
    Location
    Rutherfordton, NC
    MS-Off Ver
    Excel 2007
    Posts
    39

    Re: Search efficiency

    One minute and I'll get it for you.

  7. #7
    Registered User
    Join Date
    05-24-2010
    Location
    Rutherfordton, NC
    MS-Off Ver
    Excel 2007
    Posts
    39

    Re: Search efficiency

    Here is the data which I am using. The code is not included, due to the file size limit on uploads to your forum. If you want, I can email you a copy with the code in it.

    Water Meter Billing, Groves tab, is where you find the meter numbers that will, along with the meter reading date. This is what is searched for on the Readings tab(there are actually 4,000 lines on this sheet). The number in column 6 is what should be pasted as the begin read for the line of readings on the begin date, and same for the end readings.

    Let me know if I need to clarify any further.
    Attached Files Attached Files

  8. #8
    Forum Moderator - RIP Richard Buttrey's Avatar
    Join Date
    01-14-2008
    Location
    Stockton Heath, Cheshire, UK
    MS-Off Ver
    Office 365, Excel for Windows 2010 & Excel for Mac
    Posts
    29,464

    Re: Search efficiency

    Hi,

    It's still not entirely clear. It's always best if you can show typical examples of the results you expect with a short narrative as to the rules you've applied and the cells/sheets involved in arriving at the results.
    And since your basic question is about your code we really do need to see that in the context of the workbook. The file example is very small and there's no reason why the addition of the code modules should stop it uploading.

    Upload the file including macros and the details above and no doubt we can then help.

    Rgds
    Richard Buttrey

    RIP - d. 06/10/2022

    If any of the responses have helped then please consider rating them by clicking the small star icon below the post.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Tags for this Thread

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