Even more worth noting is something like this
Those 3 statements appear in the same IF block.
There are 369 source lines in the code you posted. It is probably the most inefficient procedure I've seen posted on a forum. That's not your fault it's just the way the macro recorder works - but you didn't even think about the steps you were taking while recording it and so have ended up with redundant statements like that (There are probably more of then, I really don't feel like wasting time looking).
The first hundred lines of opening all the sheets is crucial
Of course, but 100 lines? As TMS said that can be condensed into 3 lines, and the whole procedure was condensed into 15 and I thought that a little verbose. However, I'm not going to post it because it is nothing to do with your problem - the root cause is elsewhere.
No one has ever encountered anything like this?
Of course we have, it's part and parcel of an event driven environment - and, ignoring my comment about 'expertise' above (That was a lie), we're experts at finding problems like that as they pop up most days, if not 2 or 3 times a day.
I have like a 15 sheet workbook
Really? Go back and count them, or just go to the Immediate Window in the VBA environment and type
If you can't even get that right...?
You don't want to post your workbook "because of sensitive information" - No one is remotely interested in your data but it will take time for you to anonymise a sample, which is probably the real reason you're so reluctant.
All in all, I'd probably suggest you abandon this thread (Ask a Mod to close it so no one else wastes time on it). It can be difficult at times to diagnose a problem, but it's a bit much to ask someone to recreate a workbook that displays your issue first.
Go back and record a sensible macro planning your steps in advance, start a new thread and post a copy of your workbook with a sample of anonymised data - you're not going to get an answer otherwise.
Bookmarks