Brand new to the forum, not a programmer...but a pretty good VBA hack for a number of years.
I am working on a project and have come to a part that has me stumped. Using the Union function, I can't seem to get a fully qualified sheet range. If the sheet is active, the code works fine...but if I run it from a different sheet it fails with "Select Method of Range Class Failed" error is 1004 of course.
Here's the code, it builds the address range fine and I can view the addresses no problem with debug...but of course they are simply like this (this is the actual debug.print output that is in the code below:
$A$5561,$A$2774:$A$2776,$A$2767:$A$2771,$A$2761:$A$2762,$A$2759,$A$2753:$A$2754,$A$2748:$A$2750,$A$2731:$A$2737,$A$2727:$A$2729,$A$2724,$A$2722,$A$2717:$A$2719,$A$2715
No sheet reference. The sheet I am referencing here is called "Movies" by codename... When I run the code from a different sheet it wants to use the active sheet, which is protected, so it fails. If I precede the SELECT line (which will eventually be a DELETE if I get it working right) by "Movies.Activate" then it works fine, but again...not want I really want.
The variables are dim in the beginning of the code and the arrSplitRowsFound array is working as it should. I am using the .Cells because I have variables that fill in the Row reference...I left them out of here for simplicity sake, but replaced them with the actual values.
Been beating my head on this one, it took me a long time to figure out why it was failing...but now that I have proven it is the active sheet issue, I don't know how to fix it.
Any help would be fantastic.
Please Login or Register to view this content.
Thanks.
Eric
Bookmarks