The technical answer is, it *can* be done in several places; that is,
example 1 will work.
The answer from experience is, it *should* be done only in one place, for a
couple of reasons. The main reason is to help prevent bugs, or to ease
debugging when the inevitable happens. This goes together with the general
rule that, except for error-handling, there should be only one exit point
for each sub/function.

Signature
Regards,
Jay Freedman
Microsoft Word MVP FAQ: http://word.mvps.org
> In a VBA function, a value is returned by assigning the function name
> to the value. Can this be done in several places (CODE EXAMPLE 1), or
[quoted text clipped - 24 lines]
> Test = ReturnVal
> End Function
Jonathan West - 18 Sep 2005 12:17 GMT
> The technical answer is, it *can* be done in several places; that is,
> example 1 will work.
[quoted text clipped - 5 lines]
> rule that, except for error-handling, there should be only one exit point
> for each sub/function.
Personally, I take a more relaxed view of this. I think that Example 1 is
perfectly good code, and reduces the amount of jumping about within a
routine and reduces the total number of lines of code.
There are cases where a single exit point would be advisable, such as where
there is a need to restore global parameters (such as the position of the
Selection) prior to exit. These issues need to be addressed on a
case-by-case basis.

Signature
Regards
Jonathan West - Word MVP
www.intelligentdocuments.co.uk
Please reply to the newsgroup
Keep your VBA code safe, sign the ClassicVB petition www.classicvb.org