+ Reply to Thread
Results 1 to 9 of 9

LENGTHY VBA Runtime

  1. #1
    Forum Contributor
    Join Date
    04-30-2013
    Location
    D.C.
    MS-Off Ver
    Excel 2010
    Posts
    192

    LENGTHY VBA Runtime

    Excellers,

    I am wondering why this VBA code is taking sooooo long to perform? Is there a way to run it quicker? I am suspecting it loops too many times.

    Help....?

    Formula: copy to clipboard
    Please Login or Register  to view this content.

  2. #2
    Forum Guru HaHoBe's Avatar
    Join Date
    02-19-2005
    Location
    Hamburg, Germany
    MS-Off Ver
    work: 2016 on Win10 (notebook), private: 2019 on Win10 (desktop), 2019 on Win11 (notebook)
    Posts
    8,198

    Re: LENGTHY VBA Runtime

    Hi, excellenthelp,

    maybe the Autofilter and action to visible rows may speed that procedure up although I think best practise could be the use of the Advanced Filter to only get the data wantd and perform further action to that range.

    Ciao,
    Holger
    Use Code-Tags for showing your code: [code] Your Code here [/code]
    Please mark your question Solved if there has been offered a solution that works fine for you

  3. #3
    Forum Guru Norie's Avatar
    Join Date
    02-02-2005
    Location
    Stirling, Scotland
    MS-Off Ver
    Microsoft Office 365
    Posts
    19,643

    Re: LENGTHY VBA Runtime

    Have you checked what ActiveSheet.UsedRange.Row.Count is returning?

    Using UsedRange to count the no of rows can sometimes give misleading results.
    If posting code please use code tags, see here.

  4. #4
    Forum Contributor
    Join Date
    04-30-2013
    Location
    D.C.
    MS-Off Ver
    Excel 2010
    Posts
    192

    Re: LENGTHY VBA Runtime

    Ahh, Norie.

    After checking, the results came as "24462". That is 24,462 rows. It could go up to 45,000 rows.

    How could this be rewritten to speed up the macro?
    Last edited by excellenthelp; 11-06-2013 at 02:47 PM.

  5. #5
    Forum Contributor
    Join Date
    04-30-2013
    Location
    D.C.
    MS-Off Ver
    Excel 2010
    Posts
    192

    Re: LENGTHY VBA Runtime

    This thread is being Bumped.

  6. #6
    Forum Guru Norie's Avatar
    Join Date
    02-02-2005
    Location
    Stirling, Scotland
    MS-Off Ver
    Microsoft Office 365
    Posts
    19,643

    Re: LENGTHY VBA Runtime

    Have you tried filtering out all the rows you don't want and then copying the rest to another sheet?

  7. #7
    Forum Contributor
    Join Date
    04-30-2013
    Location
    D.C.
    MS-Off Ver
    Excel 2010
    Posts
    192

    Re: LENGTHY VBA Runtime

    This has to be done via VBA. How can I filter it with around 45,000 rows? What is the VBA code name for it and where may I learn the code?

  8. #8
    Forum Guru Norie's Avatar
    Join Date
    02-02-2005
    Location
    Stirling, Scotland
    MS-Off Ver
    Microsoft Office 365
    Posts
    19,643

    Re: LENGTHY VBA Runtime

    Eh, I didn't mean do it manually.

    IThere are 2 types of filtering in Excel, AutoFilter and Advanced Filter both of which you'll find on the Data tab.

    In VBA they are called AutoFilter and AdvancedFilter.

  9. #9
    Forum Contributor
    Join Date
    04-30-2013
    Location
    D.C.
    MS-Off Ver
    Excel 2010
    Posts
    192

    Re: LENGTHY VBA Runtime

    Okay, thanks. I will play around with it and see what I come up.

    Thanks so much, Norie!

+ 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. Toolbar tab desc. too lengthy
    By impala096 in forum Excel General
    Replies: 0
    Last Post: 10-05-2010, 12:40 PM
  2. IF function - lengthy formulas
    By XLS-EXCEL in forum Excel General
    Replies: 4
    Last Post: 09-28-2007, 11:57 AM
  3. Lengthy problem - I am in need of help!
    By paultucker79 in forum Excel General
    Replies: 5
    Last Post: 06-20-2006, 05:50 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