+ Reply to Thread
Results 1 to 6 of 6

VBA Speed Query

  1. #1
    Valued Forum Contributor
    Join Date
    08-22-2011
    Location
    Auckland
    MS-Off Ver
    Excel 2019
    Posts
    716

    VBA Speed Query

    Hello
    If I run a macro by pressing F5, the macro runs very slowly with Excel not responding intermittently. If I use a form button to run the same macro, it runs at normal speed with no errors. Is there a setting that I've inadvertently changed? Or is it supposed to run at snails pace with F5
    Thanks
    Last edited by Philb1; 09-04-2013 at 09:41 PM.

  2. #2
    Forum Expert
    Join Date
    03-28-2012
    Location
    TBA
    MS-Off Ver
    Office 365
    Posts
    12,454

    Re: VBA Speed Query

    I suspect when you run using F5 key, you may have an active sheet name or range in your code and your cursor may/ may not on the active sheet/range.

  3. #3
    Valued Forum Contributor
    Join Date
    08-22-2011
    Location
    Auckland
    MS-Off Ver
    Excel 2019
    Posts
    716

    Re: VBA Speed Query

    I've noticed the speed changes & I don't know why. There's two workbook open at the time the macro runs with data going from one to the other & I've minimised the activations. It's obviously something I'm doing if it's supposed to run at normal speed via F5.
    If/when I find it I'll post back to let anyone who's interested know

  4. #4
    Forum Expert
    Join Date
    03-28-2012
    Location
    TBA
    MS-Off Ver
    Office 365
    Posts
    12,454

    Re: VBA Speed Query

    If you open the two books at the same time, I suspect one of the books may be active book. And when you are using F5, you may unintentionally changing the active sheet name. Pressing a button run smoothly as you are not touching any of active sheet names and range.

    It is most likely that your code has got an error and may not be obvious to see it.

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

    Re: VBA Speed Query

    Minimized the activations?

    You shouldn't need to activate or select anything, and doing so can slow code down.

    Can you post the code?
    If posting code please use code tags, see here.

  6. #6
    Valued Forum Contributor
    Join Date
    08-22-2011
    Location
    Auckland
    MS-Off Ver
    Excel 2019
    Posts
    716

    Re: VBA Speed Query

    Thanks for the replies. I found 2 things.

    1) If I fully qualified the code, I don't need activations (There were only a few). I presume by doing that it stopped excel from working out / guessing what I was referring to, as well as telling it where to go in the nicest possible way & removing any wrong referencing

    2) I found the module when exported was 63k in size. I've read that excel has a hernia when it gets near 64k. I split that in two & now have two roughly 30k modules + the variables module.

    All is well & speeding along nicely.
    On to the next project now
    Cheers

+ 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. Query-Style Custom Function needs speed boost!
    By cyber553 in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 11-24-2009, 03:19 PM
  2. How to improve web query speed
    By hegisin in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 08-18-2007, 12:40 AM
  3. Posible to speed up query update with Apllication.screenupdating?
    By Martin Los in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 04-06-2006, 04:10 AM
  4. [SOLVED] Code with query goes from greyhound to turtle speed
    By [email protected] in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 10-13-2005, 11:05 PM
  5. Macro Web Query Speed & Good Structure
    By racer25 in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 05-19-2005, 05:21 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