Greg,
Sorry for "crediting" you with Graham's code; I must have gotten my "GM's" mixed up (didn't check my sources first!). But competition is good, despite what John D. Rockefeller claimed.
Macropod, thank you. You are correct - your code runs MUCH faster than Greg's. I timed them on a 50-page document with 60 headings, and yours took 237 seconds with screen updating off, and 298 seconds with it on; Paul's ran in 1.5 seconds with updating on and 1.3 seconds with it off. Since they both produce the same results, I'd call that a "no contest".
I've added some counters and attached Paul's version for the record. Thanks, guys, for all your help!
|