Originally Posted by
TMS
Maybe, maybe not. Selecting and operating on 1,000,000+ rows x 16,000+ columns must have a memory overhead. Personally, I think it would make sense just to manipulate only the cells that you have data in.
Yes, selecting cells slows the whole process down.
Can't really do much about that. I don't have anything to test.
Regards, TMS
Originally Posted by
Andrew Poulsom
You need to qualify any unqualified properties/methods in your code and not rely on Activating/Selecting. You can use a With ... End With construct to avoid repeating the qualifications.
I finally had time to go back to this to try and remove the annoying 5 minutes weekly manual part that I've been doing to avoid the error.
So the macro bugs at the same place, but here's what's really been bugging it:
Without this part, I can loop the macro fine without any issue. So I thought that the problem was the hidden names.
So I changed the code to:
But even with this, it keeps crashing at the same place, 2nd run (or more). So I did the opposite and changed the "True" in the above code to a "False" to narrow the problem to the visible Names. With "Visible = False", the macro runs fine.
The problem is then deleting the visible names which I'm baffled with to be honest. I even copy all the cells as values so why would it be an issue?
In any case, I ran some more test. Of the 5 visible range names, I deleted 1 at a time, running the macro between each deletion, to see which were ok and which weren't.
RangeName 1 = OK
RangeName 2 = OK
RangeName 3 = OK
RangeName 4 = OK
RangeName 5 = OK
All of them were OK. I switched back to "True" and ran twice just to make sure and it bugs again. Then what??? I'm stuck. Is there an invisible visible rangeName in the Workbook that I'm missing?
Note : Everytime I say I run it twice, is because I have a backup file that I can use.
Bookmarks