Below is my code, but when I execute it takes long time. I need to optimize it so that it takes less processing time.
![]()
Please Login or Register to view this content.
Below is my code, but when I execute it takes long time. I need to optimize it so that it takes less processing time.
![]()
Please Login or Register to view this content.
Attach a sample workbook. Make sure there is just enough data to demonstrate your need. Include a BEFORE sheet and an AFTER sheet in the workbook if needed to show the process you're trying to complete or automate. Make sure your desired results are shown, mock them up manually if necessary.
Remember to desensitize the data.
Click on GO ADVANCED and then scroll down to Manage Attachments to open the upload window.
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
TMS-
Thanks for reply, I have attached sample file for reference. There is button in RFQ Sheet. When you click that it gets data from MML sheet to here. The thing is if there is more data, then it takes longer time to execute.
So I 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.
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
Ok...In my case I have different sheets. So I have to fix stuff and then try it.
Thanks
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks