![]() |
Me, I prefer a more pointer-like approach, and I prefer to keep error
checking outside loops. I'd call this a translation table rather than pointers. For the digits that are not doubled, the digit N is translated to N + 1. For digits to be doubled, you translate N to N * 2 + 1. In both cases, you subtract 9 if the result is 9. Interestingly enough, the calls to Substitute and the Like function are so slow that with this particular problem, it's actually faster to do the error checking in-line. And that's in spite of your loop executing only half as many times. |
All times are GMT +1. The time now is 08:04 AM. |
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com