Hi there:
I'm struggling trying to figure out how to loop through a known set of worksheets instead of the entire workbook. Our workbook has about 40 sheets in it, and I need to "do stuff" in about a third of them beginning at a specific row. It seems awfully inefficient to loop through all 40.. however, because I have a stop point to move to the next sheet, I'm not sure if cutting this down will make a difference, and if not, then I won't bother, however, might be good for me as an exercise to learn more.
I create an array where the element's position refers to the sheet's codename and the value of the element is where the "do stuff" happens.
If looping through the 1/3 worksheets would make this faster, then I'm thinking the solution would be a 2D array, with the sheet's codename and the starting row. However, 1) I don't think that can be done without having access to vbproject something or other (which we don't want), based on what I've read (one of the drawbacks to working with a sheet's CodeName), and 2) the array would be ugly long, since you cannot do the continuing line inside curly braces. The latter is silly, I know :p
Here's the code I'm using, I cut out a bunch of other stuff to make it easier to read; there are various conditions to handle different kinds of STUFF, and other what nots, error checks, etc.
Thank you for your time and review.Please Login or Register to view this content.
Bookmarks