Hi, This code assumes your List of used numbers are in column "A".
The code first creates an 2 dimension Array (2 columns) all the numbers, using the last set of digits. i.e. 12200 to 12800. The code Placing all these numbers in the first column of the Array.
The code then runs through all the used numbers in column "A", checking them against the previously created Array of all numbers.
If it finds a duplicate it Places the number in column (2) of the first array, against the duplicate number in column (1) of the array.
The final loop runs through the, now modified First Array and checks for Blank spaces, these are the numbers in column (1) that have not been used.
If a Blank space is found the number in colunm (1) is places in a new array "nRay" and finally Insert in column "E".
NB:- I did it this way because I thought it would be quicker, if you have a larger set of numbers.
Hope this helps
Regards Mick
Bookmarks