You might find this makes the loop structure clearer...
The only addition is the Start row should be defined.
A couple of things to note:
Indent your control structures - it makes it a lot easier to see the logic flow. There are free utilities to do this. One of the best is MZTools (which has other functions as well). Any search will find it. You need MZ Tools 3.0 for VBA. It's so old it's being given away free but there is a paid for version as well.
Use 'Option Compare Text' (See Help or search). This makes string comparisons case insensitive and avoids the 'A' <> 'a' problem.
Use 'Option Explicit'. You will have to declare all variables before use and prevents undefined variables creeping in and causing hard to find bugs. Again, any basic search will find a load of info.
And finally - you might be surprised by the etymology of the word dunce. Just like 'awful' it meant something completely different before. Both have totally reversed in meaning. Awful originally meant 'awe inspiring' and 'dunce' is (allegedly) dereived from John Duns Scotus, considered to be one of the three most important philosopher-theologians of the 13thc.
Bookmarks