+ Reply to Thread
Results 1 to 9 of 9

Modification suggestion(s) to speed up my code

  1. #1
    Forum Contributor
    Join Date
    11-11-2012
    Location
    Muscat, Oman
    MS-Off Ver
    Office 365
    Posts
    521

    Modification suggestion(s) to speed up my code

    Dear Experts,

    I have a long code created with the help various experts here.
    This code handles 999,999 rows and 20 columns in one sheet. Entire process takes a long time and now I am trying to improvise various pieces put together and again seeking help here to make it a better code. The part of code shown below takes 43.64 seconds just wanted to check if this is reasonable time for the process!!!!

    Looking for any help to improvise as entire code takes about 7 minutes to run.

    Please Login or Register  to view this content.
    Best Regards/VKS

  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: Modification suggestion(s) to speed up my code

    Whoa, whoa,

    Too many .Selects for my liking.

    You could try putting the Application into manual calculation mode and then switching it back on when the procedure finishes

    Application.Calculation = xlCalculationManual
    Application.Calculation = xlCalculationAUtomatic

    But in all honesty you need to upload the workbook and tell us in a narrative what you're trying to do.
    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
    Forum Contributor
    Join Date
    11-11-2012
    Location
    Muscat, Oman
    MS-Off Ver
    Office 365
    Posts
    521

    Re: Modification suggestion(s) to speed up my code

    Thanks a lot for your comments Richard Buttrey.
    I thought as much that members would want to see the data but i cant post the original data. I can try to post some sample sheet but do u think its necessary that sample sheet also goes down to 999,999 rows..... also if i post the entire thing then it may appear as a project and most of the members may lose interest thats why tired with first part of the macro.
    Best Regards/VKS

  4. #4
    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: Modification suggestion(s) to speed up my code

    No, we certainly don't need 999,999 rows. A few will do as long as they are representative.

    Why would we worry about whether it's a 'project'?

    Time for the workbook suitably reduced methinks.

  5. #5
    Forum Contributor
    Join Date
    11-11-2012
    Location
    Muscat, Oman
    MS-Off Ver
    Office 365
    Posts
    521

    Re: Modification suggestion(s) to speed up my code

    Thanks for your comments.... let me start working on a sample sheet that represents real data.
    Narrative may take bit longer than sample sheet but i shall try to make it a detailed one.
    Thanks for your help
    VKS

  6. #6
    Registered User
    Join Date
    09-12-2013
    Location
    Holland
    MS-Off Ver
    Excel 2013
    Posts
    13

    Re: Modification suggestion(s) to speed up my code

    See Richards answer.

    change
    Please Login or Register  to view this content.
    into

    Please Login or Register  to view this content.

    Avoid .Select. It looks like the macro was recorded with the macro-recorder. Change the code manually and delete all the .Selects.

  7. #7
    Forum Contributor
    Join Date
    11-11-2012
    Location
    Muscat, Oman
    MS-Off Ver
    Office 365
    Posts
    521

    Re: Modification suggestion(s) to speed up my code

    Hi, Attached, please find a sample sheet with limited data and explanation of what i am trying to reach with the part of code above.
    Hope this makes it bit clear...
    Best Regards/VKS
    Attached Files Attached Files

  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: Modification suggestion(s) to speed up my code

    Try this.
    Please Login or Register  to view this content.
    If posting code please use code tags, see here.

  9. #9
    Forum Contributor
    Join Date
    11-11-2012
    Location
    Muscat, Oman
    MS-Off Ver
    Office 365
    Posts
    521

    Re: Modification suggestion(s) to speed up my code

    Thanks a lot Norie its gone down to 19 secs

+ 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. Little modification in code
    By mukeshbaviskar in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 05-18-2013, 02:15 PM
  2. code explanation and suggestion
    By JohnSeito in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 12-10-2007, 08:04 PM
  3. [SOLVED] code suggestion
    By sunkosi in forum Excel General
    Replies: 2
    Last Post: 05-04-2006, 10:30 PM
  4. Looking For A Suggestion About How To Write Code
    By abxy in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 12-07-2005, 03:15 PM
  5. modification for the code
    By srinivasan in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 08-20-2005, 11:05 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