Results 1 to 5 of 5

Need to optimize the code

Threaded View

  1. #4
    Forum Expert
    Join Date
    10-02-2014
    Location
    USA
    MS-Off Ver
    2016
    Posts
    1,222

    Re: Need to optimize the code

    If you are just moving data without any conditions or at least moving a block of cells/data this is the fastest method for doing so. See attached sample.

    Basically dump the source range to an array and then dump the array into the destination range.

    EDIT: It also doesnt help you have 38,534 styles in the workbook you attached. Presuming its based on your actual file you likely have the same issue in your file.

    Your used range in the MML sheet goes way beyond your data too. So you have excess cells.

    Also your module 2 code appears like it may not be very efficient though its not 100% clear what your doing, can you explain the purpose of the AddSheets routine and the logic behind it?

    You also use a table in MML sheet but do not use any listobject parts (rows, columns, etc) in your code.
    Attached Files Attached Files
    Last edited by Zer0Cool; 02-05-2018 at 01:20 PM.
    Ways to get help: Post clear questions, explain your overall goal, supply as much background as possible, respond to questions asked of you by those trying to help and post sample(s) files.

    "I am here to help, not do it for people" -Me

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Optimize a code
    By pezalmendra in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 03-06-2015, 05:31 PM
  2. Optimize code
    By DarkKnightLupo in forum Excel Programming / VBA / Macros
    Replies: 22
    Last Post: 02-19-2014, 08:58 AM
  3. Optimize a slow code...
    By benoitly in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 04-02-2013, 01:44 PM
  4. optimize the Code needs to run faster
    By farrukh in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 01-24-2012, 10:40 AM
  5. Optimize code
    By miso.dca in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 02-08-2011, 03:35 PM
  6. How can I optimize/simplify that code ?
    By Grek in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 01-08-2010, 03:38 PM
  7. Optimize VBA code
    By doodlebug in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 05-22-2007, 07:53 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