+ Reply to Thread
Results 1 to 3 of 3

Pass from a for cicle to a search cicle

  1. #1
    Registered User
    Join Date
    11-12-2009
    Location
    Lucca, Italy
    MS-Off Ver
    Excel 2003
    Posts
    53

    Pass from a for cicle to a search cicle

    To increase performance I would like to optimize the following macro. Probably passing from a for cicle to a search.
    Any suggestion?

    Please Login or Register  to view this content.

  2. #2
    Forum Expert Olly's Avatar
    Join Date
    09-10-2013
    Location
    Darlington, UK
    MS-Off Ver
    Excel 2016, 2019, 365
    Posts
    6,284

    Re: Pass from a for cicle to a search cicle

    Try:
    Please Login or Register  to view this content.
    Last edited by Olly; 07-21-2014 at 04:49 AM.
    let Source = #table({"Question","Thread", "User"},{{"Answered","Mark Solved", "Add Reputation"}}) in Source

    If I give you Power Query (Get & Transform Data) code, and you don't know what to do with it, then CLICK HERE

    Walking the tightrope between genius and eejit...

  3. #3
    Valued Forum Contributor Hawkeye16's Avatar
    Join Date
    02-27-2013
    Location
    Holland
    MS-Off Ver
    ├•┤ Pew Pew
    Posts
    441

    Re: Pass from a for cicle to a search cicle

    I am not sure the for loop is your biggest problem. Is there a reason you are pulling in 322,000 rows for each array every time. Is there a set number of entries? If there is usually less than that you can just pull in what is needed and run through that (since you only run through 234,100 for the bigger array anyway).

    You can also move certain things around to require less calculations such as moving the MyVar = DataRange(Irow,1) before the second for loop starts. This will take out (234,100 x 321,999) calculations that the macro has to run.

    I like Olly's solution. Nice and simple. No pulling data into arrays.
    Last edited by Hawkeye16; 07-21-2014 at 04:53 AM.
    Despite the high cost of living, it remains very popular.

    Don't forget to mark threads SOLVED when you get an answer and rep all the geniouses that helped you today!

+ 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. Why cant i pass an integer to the filter search criteria???????????
    By JamesGoulding85 in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 04-17-2014, 06:34 AM
  2. [SOLVED] Search for decimal and when found pass row number to rest of string
    By beenbee in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 02-12-2014, 07:14 AM
  3. Sum cell (cicle) with range boundaries
    By jmaocubo in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 02-01-2013, 02:35 PM
  4. Replies: 3
    Last Post: 06-07-2012, 07:25 PM
  5. [SOLVED] Analyze Within An Array and Pass Back Once vs. Pass at each applicable Instance
    By AlvaroSiza in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 05-11-2012, 05:25 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