+ Reply to Thread
Results 1 to 8 of 8

Improve Loop Speed

  1. #1
    Registered User
    Join Date
    05-27-2011
    Location
    Virginia
    MS-Off Ver
    Excel 365
    Posts
    86

    Improve Loop Speed

    Hello experts,

    I've been trying to find a better method for a looping macro that takes several minutes for over 800,000 rows. If the code below can be improved please assist if you can?
    Thanks in advance.

    Please Login or Register  to view this content.

  2. #2
    Forum Expert Mumps1's Avatar
    Join Date
    10-10-2012
    Location
    Toronto, Canada
    MS-Off Ver
    Excel 2010, 2013
    Posts
    7,777

    Re: Improve Loop Speed

    I can't promise a solution, but it would be easier to help and test possible solutions if you could attach a copy of your file. Explain in detail what you want to do referring to specific cells, rows, columns and sheets using a few examples from your data (de-sensitized if necessary). I wouldn't need all 800,000 rows of data. Twenty to thirty rows should be enough. See the yellow banner at the top of this page for instructions to attach a file.
    You can say "THANK YOU" for help received by clicking the Star symbol at the bottom left of the helper's post.
    Practice makes perfect. I'm very far from perfect so I'm still practising.

  3. #3
    Registered User
    Join Date
    05-27-2011
    Location
    Virginia
    MS-Off Ver
    Excel 365
    Posts
    86

    Re: Improve Loop Speed

    Thanks Mumps1 for your response. I've really sanitized this file so it's a fair example.
    Attached Files Attached Files

  4. #4
    Forum Expert Mumps1's Avatar
    Join Date
    10-10-2012
    Location
    Toronto, Canada
    MS-Off Ver
    Excel 2010, 2013
    Posts
    7,777

    Re: Improve Loop Speed

    Try:
    Please Login or Register  to view this content.

  5. #5
    Forum Expert sintek's Avatar
    Join Date
    12-04-2015
    Location
    Cape Town
    MS-Off Ver
    2013 | 2016 | 2019
    Posts
    13,122

    Re: Improve Loop Speed

    This makes no sense...even with sample file...What is it you are actually wanting to achieve...
    When a cell in Col A is like "P*" then add the word data next to it?
    Good Luck
    I don't presume to know what I am doing, however, just like you, I too started somewhere...
    One-day, One-problem at a time!!!
    If you feel I have helped, please click on the star to left of post [Add Reputation]
    Also....add a comment if you like!!!!
    And remember...Mark Thread as Solved.
    Excel Forum Rocks!!!

  6. #6
    Valued Forum Contributor
    Join Date
    08-08-2022
    Location
    Buenos Aires
    MS-Off Ver
    Excel 2019
    Posts
    1,777

    Re: Improve Loop Speed

    Hello MusicMan (and everyone): You are not presenting your difficulty well!

    So I suggest you upload a two page workbook to the Forum:
    - In the first you show us what you have;
    - And in the second you show us the final expected result.

    Of course, we are not talking about your example having 800 thousand rows, but 20 or 30 rows.

  7. #7
    Forum Expert sintek's Avatar
    Join Date
    12-04-2015
    Location
    Cape Town
    MS-Off Ver
    2013 | 2016 | 2019
    Posts
    13,122

    Re: Improve Loop Speed

    Perhaps?
    Please Login or Register  to view this content.

  8. #8
    Registered User
    Join Date
    05-27-2011
    Location
    Virginia
    MS-Off Ver
    Excel 365
    Posts
    86

    Re: Improve Loop Speed

    Thank you both Mumps1 and sintek. Sintek's code is the one that worked best for me. I am simply converting a large set of raw data imported from several pdf files into excel which we eventually transform into a usable table at my work place. P1, P2, P3, etc.. identifies each pdf page number and "Data:" represents the first set of characters before each unique job title. The time is greatly reduced and this works well for me. It is combined with another set of code which yields a final product.

    Thank you both very much once again for your time and expertise.

+ 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. Improve speed of VBA code
    By markgoldmedal in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 11-28-2021, 05:45 PM
  2. [SOLVED] Improve Speed: VBA Code very slow due to changing cell values in for loop
    By Nick_G in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 01-29-2020, 03:25 PM
  3. [SOLVED] Improve UDF speed
    By pdauction in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 02-07-2018, 05:51 AM
  4. [SOLVED] Need improve macro speed
    By Remphan in forum Excel Programming / VBA / Macros
    Replies: 23
    Last Post: 12-29-2015, 10:43 AM
  5. Improve Calculations Speed
    By samcdavies in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 11-21-2015, 09:14 PM
  6. [SOLVED] Improve speed of Sort!
    By stockgoblin42 in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 04-29-2013, 03:12 PM
  7. How to improve web query speed
    By hegisin in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 08-18-2007, 12:40 AM

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