If you want to perform a random pick on some items (names, numbers, whatever), and these items can occur more than once but you need them not to re-appear within the next N draws, the function shown here will help.
It calls sbRandHistoGrm which you will need to include into your VBA code.
This function is a fairly advanced example on how to use scripting dictionaries (associative arrays). It shows:
- How to attach values to names (keys)
- How to add, to remove and to change key / value pairs
- How to look up values
- How to access the whole value set as an array
- How to test whether a dictionary is empty (i.e. has no entries)
- How to access values numerically indexed (can be used to numerically index through the key or value set)
An example for N = 3: