This has always been one thing that has bothered me--the way my Excel handles the For Each loop. I have to ask if my version of Excel is somehow defective or deficient???
From what I've read elsewhere, I can use the For Each method to loop through a collection (in this particular case, a worksheet's sheets), having the same conditions applied to each. Now, if I apply For Each to cells within a range, it will work fine; there are no problems with that.
HOWEVER, when I try to loop through a workbook, it will only apply the conditions to the ActiveSheet, though it will maintain the total number of sheets within the loop. I can adjust the macro to accomodate for this, but I always "thought" that it's supposed to do this for you--that is, apply the same things to each sheet automatically.
Below is an example of a loop I'd like to have put the number 1 on each sheet. If I remove the text statements, it will do it just fine. But, as-is, with the For Each loop, it will not.
Am I missing something? Could someone else try this code as-is (without removing the text-statements) and see if it puts the number 1 in each cell B2? Is it just my particular Excel?