on 10/8/2011, parahumanoid supposed :
It's only a matter of my poor translation. I'm using a Russian
localized version, so there is another variable name used instead of
ThisWorkBook. And it apparently "kind of" works because if I put a
MsgBox inside the loop it fires the expected number of times (the
number of formula cells on the active sheet), but the replacement,
regardless of the "True" state of the Replace function's result, does
not occur. Could it be that I never turned the screenupdating back on?
ScreenUpdating will get turned back on when the procedure that turned
it off ends. This means the original procedure not sub procedures
called by it.
In any case, it's always good to have the procedure that turns
ScreenUpdating off to also 'explicitly' turn it back on as good
programming practice. <FYIAnytime we leave things up to
VB[A] to do
implicitly it requires extra processing by
VB[A} to evaluate what
action to take. Better to save that extra processing and just tell
VB[A} what to do. Might not seem a big deal on a one-by-one basis but
it's the cummulative effect over the entire project that's the concern
here.
3 Simple rules:
If your code creates objects, your code should explicitly destroy
them when no longer needed.
If your code changes Excel settings it should explicitly restore them
before closing.
If your code modifies menus/toolbars it should remove those
modifications before closing.
--
Garry
Free usenet access at
http://www.eternal-september.org
ClassicVB Users Regroup! comp.lang.basic.visual.misc