+ Reply to Thread
Results 1 to 19 of 19

Need help to make code faster (The code copy/paste)

  1. #1
    Registered User
    Join Date
    06-02-2020
    Location
    London
    MS-Off Ver
    365
    Posts
    9

    Need help to make code faster (The code copy/paste)

    Anybody?

    Hello,

    I have some code that I would like to make faster, but I do not know how. The code is in the excel sheet. Please help me !

    1) Init combo boxes
    2) Select Weeks
    3) Select cycles

    /B
    Attached Files Attached Files
    Last edited by Beginner77; 07-17-2020 at 02:59 AM.

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

    Re: Need help to make code faster (The code copy/paste)

    For starters...

    Please Login or Register  to view this content.
    Or initiate in workbook Open Event

    Not sure what you mean by other requests...perhaps you should explain in detail what you are wanting to achieve....
    Last edited by sintek; 07-17-2020 at 07:06 AM.
    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!!!

  3. #3
    Registered User
    Join Date
    06-02-2020
    Location
    London
    MS-Off Ver
    365
    Posts
    9

    Re: Need help to make code faster (The code copy/paste)

    Thanks. It is the other code that takes quite a long time to execute. I would like to run the code faster. That is my goal.

    Cheers B

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

    Re: Need help to make code faster (The code copy/paste)

    As per post 2...
    perhaps you should explain in detail what you are wanting to achieve....

    This will make us simplify...Your code is too complicated to follow with all the named variables...Also there is no sample data with before | after requirement...

  5. #5
    Registered User
    Join Date
    06-02-2020
    Location
    London
    MS-Off Ver
    365
    Posts
    9

    Re: Need help to make code faster (The code copy/paste)

    I would like to have it running faster, say under 1 second if possible.

    Have you tried the code? If you try you see that the code is not difficult to understand. I got three named area. Not so many. If you think you can not help, do do not need to answer.

    Cheers
    Last edited by Beginner77; 07-17-2020 at 08:09 AM.

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

    Re: Need help to make code faster (The code copy/paste)

    If you think you can not help, do do not need to answer.
    I can help...
    However, I would prefer you to explain in detail what you are wanting to achieve instead of having to decipher your code...Which in itself is not simplistic...
    I have requested an explanation 3 times already...
    Other members are going to ask the same...SEE TOP YELLOW BANNER....

    If you are not prepared to explain then I am not prepared to help...
    Don't want to have to figure out this...
    Untitled.png
    Last edited by sintek; 07-17-2020 at 08:25 AM.

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

    Re: Need help to make code faster (The code copy/paste)

    How difficult would it have been for you to say...

    "I want to create Templates from sheet2 dependent on selections made"

    Perhaps someone else can simplify...Can only do 2 seconds for 12 X 12
    Please Login or Register  to view this content.
    Last edited by sintek; 07-17-2020 at 10:49 AM.

  8. #8
    Forum Expert torachan's Avatar
    Join Date
    12-27-2012
    Location
    market harborough, england
    MS-Off Ver
    Excel 2010
    Posts
    4,304

    Re: Need help to make code faster (The code copy/paste)

    I would like to make faster, but I do not know how
    @Beginner77, you are the one seeking help.
    If you think you can not help, do do not need to answer.
    Re-read your second quote, rather a poor choice of wording towards someone that has offered you help.
    @sintek is being polite about a 'dogs breakfast'.
    You may find further down the road it would be prudent to get rid of 'merged cells' if you expect VBA to be stable.
    torachan.

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

    Re: Need help to make code faster (The code copy/paste)

    I just realized my code does not provide the correct output...I guess your explanation was not clear enough...

    Perhaps this...
    Please Login or Register  to view this content.
    Last edited by sintek; 07-17-2020 at 12:30 PM. Reason: Spacing....

  10. #10
    Valued Forum Contributor
    Join Date
    08-03-2012
    Location
    Newcastle
    MS-Off Ver
    Excel 2007, 2010, 2013, 2016, Office 365
    Posts
    467

    Re: Need help to make code faster (The code copy/paste)

    Hi Beginner77

    OK, here's my version attached.
    It can be made tidier, but I spent the time learning a couple of Swedish words instead.
    On my system it was pretty fast.

    zeddy
    Attached Files Attached Files

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

    Re: Need help to make code faster (The code copy/paste)

    Just for the fun of it...Without Merged cells etc etc...
    Rule 1 of Excel...Do not use merged cells...Just causes havoc with VBA...See Horizontal Alignment as alternative...

    Grid 12 x 12...Under a second....

    For future reference...We do not request information "just to be funny"...It is in order to understand your requirement so as to
    provide the most simplistic code possible for your scenario...

    Be more forthcoming in the future...

    I am certain other members will also offer more expedient solutions...
    Attached Files Attached Files

  12. #12
    Registered User
    Join Date
    06-02-2020
    Location
    London
    MS-Off Ver
    365
    Posts
    9

    Re: Need help to make code faster (The code copy/paste)

    Thank you all for the help! Very appreciated!!

  13. #13
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    80,914

    Re: Need help to make code faster (The code copy/paste)

    If that takes care of your original question, please select Thread Tools from the menu link above and mark this thread as SOLVED.
    Ali


    Enthusiastic self-taught user of MS Excel who's always learning!
    Don't forget to say "thank you" in your thread to anyone who has offered you help.
    You can reward them by clicking on * Add Reputation below their user name on the left, if you wish.

    Forum Rules (updated August 2023): please read them here.

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

    Re: Need help to make code faster (The code copy/paste)

    For future reference...As a courtesy...If you want to thank Members...You can click Star Left of Post...Add Reputation...

  15. #15
    Valued Forum Contributor
    Join Date
    08-03-2012
    Location
    Newcastle
    MS-Off Ver
    Excel 2007, 2010, 2013, 2016, Office 365
    Posts
    467

    Re: Need help to make code faster (The code copy/paste)

    Hi

    I was still working on a faster method.

    I adapted sinteks file with my updates and managed to get the 12x12 grid in 0.016 sec (on Dell i7 laptop)
    Could probably get it to 0.012 sec with further changes but then boss said stop doing that.

    For automation, if things take less than 2 seconds, Users are generally happy. Anything longer than that, they start twiddling their thumbs or go for a coffee.

    zeddy
    Attached Images Attached Images

  16. #16
    Forum Contributor tax112's Avatar
    Join Date
    02-28-2013
    Location
    Thailand
    MS-Off Ver
    Excel 2016 | 2019
    Posts
    438

    Re: Need help to make code faster (The code copy/paste)

    --------------------------

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

    Re: Need help to make code faster (The code copy/paste)

    @sintek
    Re: "Rule 1 of Excel...Do not use merged cells"

    You forgot Rule #2

    Rule #2:
    Read Rule #1 again.
    Experience trumps academics every day of the week and twice on Sunday.

  18. #18
    Valued Forum Contributor
    Join Date
    08-03-2012
    Location
    Newcastle
    MS-Off Ver
    Excel 2007, 2010, 2013, 2016, Office 365
    Posts
    467

    Re: Need help to make code faster (The code copy/paste)

    Three years for a reply to my post!
    That is even more impressive than the slow pace of life I'm having on my tropical vacation.
    It's rum o'clock now so it's back to the beach for me.
    Best regards
    zeddy

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

    Re: Need help to make code faster (The code copy/paste)

    I promise (again)
    Next time I check the dates a little closer.

    Have a tasty toddy.

+ 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. Any idea to make this code work faster ( copy and paste data )
    By HaroonSid in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 04-25-2017, 03:33 AM
  2. [SOLVED] Need make code faster.
    By abjac in forum Excel Programming / VBA / Macros
    Replies: 13
    Last Post: 05-28-2016, 04:21 AM
  3. How to make my code faster?
    By chrisignm in forum Excel Programming / VBA / Macros
    Replies: 9
    Last Post: 01-12-2016, 08:08 PM
  4. [SOLVED] Make code Faster
    By zplugger in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 11-30-2013, 10:08 AM
  5. Make VBA code faster
    By Danielle22 in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 10-28-2013, 09:01 AM
  6. [SOLVED] Make code run faster
    By ozhunter in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 02-20-2013, 04:26 AM
  7. [SOLVED] Need Help with making copy and paste code faster
    By Wes88 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 06-04-2012, 10:36 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