+ Reply to Thread
Results 1 to 10 of 10

VBA Code is running really slowly

Hybrid View

  1. #1
    Registered User
    Join Date
    03-13-2014
    Location
    Miami
    MS-Off Ver
    Excel 2010
    Posts
    42

    Re: VBA Code is running really slowly

    Hmmm, its still taking a long time to run, do you have any other ideas? the problem seems to be that Im copying anf pasting some really long formulas. Evenwhen I try to do a manual copy and paste, the sheet does not update.

  2. #2
    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: VBA Code is running really slowly

    Hi,

    Maybe it's time to upload the workbook (cut down as much as necessary in order to upload) so that we can see the request in context.

    One technique I often use to identify the problem area is to step through the macro with the F8 key and see how long the cursor takes to become live and postion itself on the next code line. Usually of course it's instantaneous so doing this you should find which is the line that is taking the time.

    You can effectively 'deactivate' any procedure by using a variable and testing the variable as the first line of the procedure. So assuming you want to control the procedure from say the A1 value in Sheet1 then put say the word 'Stop' in A1 and in the procedure

    If Sheet1.Range("A1") = "Stop" Then End 'or Exit Sub
    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.

  3. #3
    Registered User
    Join Date
    03-13-2014
    Location
    Miami
    MS-Off Ver
    Excel 2010
    Posts
    42

    Re: VBA Code is running really slowly

    Hi Richard,

    The code always fails when it gets to the line "ActiveSheet.paste". I think that the reason is because there is just too much data for excel to deal with. the file is about 8 MBs and has several tabs, all of which depend on the tab I'm working on. infact, even when I try to do manually what the code does automatically, excel still runs into trouble when it tries to paste the information.

    I'll try to trim down the work file, but its a bit difficult to get it down to 1MB. I'll try to post the file in two pieces with the relevant information.

    thanks for the help.

  4. #4
    Forum Expert
    Join Date
    10-06-2008
    Location
    Canada
    MS-Off Ver
    2007 / 2013
    Posts
    5,692

    Re: VBA Code is running really slowly

    Showing the code would certainly help I am sure.
    Show where the code is, Regular Module, Sheet Module or This Workbook Module.

+ 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. Code running really slowly
    By The Phil in forum Excel Programming / VBA / Macros
    Replies: 9
    Last Post: 04-03-2014, 08:42 PM
  2. [SOLVED] Code running slowly
    By Sweepin in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 09-30-2013, 09:15 PM
  3. [SOLVED] Code running slowly any way of speeding up processing time
    By boomboomblock in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 07-02-2013, 09:09 AM
  4. Code running slowly
    By rhudgins in forum Excel Programming / VBA / Macros
    Replies: 18
    Last Post: 02-01-2011, 11:08 AM
  5. Paste code running extremely slowly...
    By KR in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 08-03-2005, 11:05 AM

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