i currently have a formula in a cell that makes a large random number

=RAND()*(100000-12000000)+12000000
the random number is use as a order number and is put with other data in a list of orders.

how to i make an if statement inside a macro which will search down a set of rows to see if there is a duplicate number in order to made sure the same number is not used twice

thanks for any help