Mike,
After looking over the code, I see that it has a lot of Select statements. Those are completely unnecessary. For example, instead of:
It can be written as:
Very rarely is it actually necessary to select something to work with it. Select statements cause extra unnecessary function calls than can slow down code. I also see you use "For i = x to y" loops with ActiveCell.Offset(i...). Again, there's no need to use Select and rely on ActiveCell. Just work with the range directly:
That code will put the numbered sequence in the desired cells, without using a loop, and without using Select or ActiveCell statements.
Also, the majority of the code is now formatting. Formatting via VBA is just slow, not much can be done about that. Removing default value statements can help slightly. These are unnecessary for example:
Also, you can apply formatting to several cells at the same time, instead of one cell at a time. Just separate range groups with a comma (note that you only need to set the LineStyle to xlContinuous because the rest is default and doesn't need to be specified):
I also saw you have screeupdating turned off and back on again before all code and after all code. While it won't impact speed at all, that is unnecessary because during the "With Application" blocks at the beginning and end of the code screenupdating is already getting turned off and then back on.
Bookmarks