View Single Post
  #8   Report Post  
Posted to microsoft.public.excel.programming
merjet merjet is offline
external usenet poster
 
Posts: 812
Default Generate Random Groupings from List

The code I wrote in #2 was for your original specs. The number of
lines it takes is 5, which is hard-coded. If there are 19 names in the
list, it still takes 4 groups of 5. The last one is empty, so you
don't see it. If there were 18 names, the 4th group would get only 3.
The number of groups is also hard-coded to 4 by the '0 to 3' loop
parameters.

Your latest post implies different specs than your original ones. It
calls for potentially a different number of groups and a different
number of names in each one. Obviously that would require some more
flexible VBA code (less hard-coding).

Hth,
Merjet