Backup your data.
I haven't tested this code.
The idea behind my changes is very simple.
You have two blocks of code which copy cells from sheet2 to sheet1.
Each block contains around 20 lines.
Thus you are reading values from and to the workbook about 40 times for each block.
I've reduced this to just 3 per block.
Since all the cells are in the same row,
I copied two rows of data, one row from sheet 1, one row from sheet 2.
The values are transferred from one array to the other (just as you had it before).
Then the values in Sheet 1 are read back into the workbook.
To be honest, I've never tested this idea in a big project like yours.
I'll be interested to see if it really saves times (like I've been told).
Please let me know how it works out.
P.S. I hope I haven't made any errors when I was cutting and pasting.
P.S.S. Always use longs over integers (computers today find longs faster than integers).
Bookmarks