I'm very tempted to upvote, for this is a very similar approach to mine (key being
Selection.Areas
, missed by the other answer), however triple-nested loops and repetitive dereferencing of the
.Areas(k)
reference, combined with the poor variable names and confusing data types used (there's not really any reason to use
Integer
anywhere other than in Win32 API calls that require it), are holding me back.
For
loop iterating the areas is a missed opportunity: a
For Each
would dereference the current area only once per iteration, vs. 6 times here. Also the type of
Selection
is assumed. —
Mathieu Guindon 28 mins ago