+ Reply to Thread
Results 1 to 9 of 9

Need to speed up this code

  1. #1
    Registered User
    Join Date
    01-31-2021
    Location
    London
    MS-Off Ver
    365
    Posts
    77

    Need to speed up this code

    Hi guys,

    Written this bit of code to copy from one spreadsheet to another. It runs really slow, how can I speed this up??

    Please Login or Register  to view this content.

    Reports = filename of other worksheet
    ASM = sheet name


    Any help would be appreciated..


    Cheers,
    Last edited by GeekBlueNose; 10-22-2024 at 03:33 PM.

  2. #2
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    49,381

    Re: Need to speed up this code

    Don't select workbooks, worksheets or ranges.

    Use Application.ScreenUpdating = False before executing your code.


    Fast answers need visual help. Please read the yellow banner at the top of this page on how to attach a file and a mocked up solution.
    Trevor Shuttleworth - Retired Excel/VBA Consultant

    I dream of a better world where chickens can cross the road without having their motives questioned

    'Being unapologetic means never having to say you're sorry' John Cooper Clarke


  3. #3
    Registered User
    Join Date
    01-31-2021
    Location
    London
    MS-Off Ver
    365
    Posts
    77

    Re: Need to speed up this code

    Hi TMS,

    I've used application.screenupdating = false in another sub wheich then calls thus sub...

    I guessed that the reason it is slow is down to selecting the workbook and sheets but my VBA knowledge isnt good enough to write this another way.. I've tried but keep getting in a muddle, could you show me so I knwo in future

  4. #4
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    49,381

    Re: Need to speed up this code

    I've used application.screenupdating = false in another sub wheich then calls thus sub...
    You may know that but no-one else has access to that code. Don't expect advice and guidance unless you share all the code, suitably redacted source and target files, with expected results.

    I repeat: Fast answers need visual help. Please read the yellow banner at the top of this page on how to attach a file and a mocked up solution.

  5. #5
    Valued Forum Contributor MikeVol's Avatar
    Join Date
    12-30-2020
    Location
    Odessa / Ukraine
    MS-Off Ver
    MSO Prof Plus 2021 x64 (En)
    Posts
    638

    Re: Need to speed up this code

    Hello @GeekBlueNose. Try next optimized code.
    Please Login or Register  to view this content.
    It was my pleasure to help you. Good luck.
    Last edited by MikeVol; 10-23-2024 at 01:14 AM. Reason: Removed the extra variable.
    NOTE: As the original poster/owner, only you can mark your thread as SOLVED (Thread Tools above Post #1).
    You can say "Thanks" in your thread to everyone who offered to help you.
    You can also reward them by clicking * "Add Reputation" under their username on the left.
    With Regards, MikeVol.

  6. #6
    Forum Expert
    Join Date
    10-06-2017
    Location
    drevni ruchadlo
    MS-Off Ver
    old
    Posts
    2,308

    Re: Need to speed up this code

    ???
    Please Login or Register  to view this content.

  7. #7
    Valued Forum Contributor MikeVol's Avatar
    Join Date
    12-30-2020
    Location
    Odessa / Ukraine
    MS-Off Ver
    MSO Prof Plus 2021 x64 (En)
    Posts
    638

    Re: Need to speed up this code

    Hello @mjr veverka Method or data member not found in line:
    Please Login or Register  to view this content.
    The expression is highlighted:
    Please Login or Register  to view this content.
    ???

  8. #8
    Forum Expert
    Join Date
    10-06-2017
    Location
    drevni ruchadlo
    MS-Off Ver
    old
    Posts
    2,308

    Re: Need to speed up this code

    Quote Originally Posted by MikeVol View Post
    Method or data member not found ... ???
    Quote Originally Posted by mjr veverka View Post
    Sub allee_kiha()
    ... allee kiha ! ... that's true ! ... koozva ...
    Please Login or Register  to view this content.

  9. #9
    Registered User
    Join Date
    01-31-2021
    Location
    London
    MS-Off Ver
    365
    Posts
    77

    Re: Need to speed up this code

    Hi guys,

    I managed to try your solution mike yesterday and it worked like a charm.. Thaks so much ... That bit of code is an absolute game changer for me..

    mjrveverka No need to try your solution but do you think it's a better way of doing it, seems to use a bit less coding.

+ 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. [SOLVED] Speed up code? This simple VBA code makes me a report but its taking 20 minutes to finish
    By adamasmay in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 02-08-2022, 07:32 AM
  2. Speed up Code
    By chrisellis250 in forum Excel Programming / VBA / Macros
    Replies: 16
    Last Post: 04-27-2019, 11:02 AM
  3. Replies: 9
    Last Post: 05-21-2018, 04:34 PM
  4. [SOLVED] VBA Delete Row Code - Need more efficient code to speed it up
    By matcapir in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 07-02-2015, 04:32 PM
  5. [SOLVED] Help to speed up code
    By saintsphan in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 04-01-2015, 12:14 AM
  6. [SOLVED] Looking for help to speed up my code.
    By s4driver in forum Excel General
    Replies: 1
    Last Post: 03-25-2015, 12:32 PM
  7. Speed up code
    By Derick Hughes in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 02-08-2005, 02:06 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