Generating unique sequential numbers in Excel

M

michael

I'd like to create a button (macro) that will generate a
unique sequential number (or a random number) with 5
digits. How do I do this.
I use Excel XP.

Thanks,
Michael
 
T

Tushar Mehta

For a few different techniques see the Excel | Tutorial | 'Random
Selection' page of my web site.

--
Regards,

Tushar Mehta, MS MVP -- Excel
www.tushar-mehta.com
Excel, PowerPoint, and VBA add-ins, tutorials
Custom MS Office productivity solutions
 
P

Peo Sjoblom

Because 10000 is the lowest 5 digit integer and 99999 is the highest
and the formula will return random values >=10000 and <=99999
if I would have used 89999 I would have left out 90000-99999
Not that I know if this is what the OP wanted since he never posted back
 
S

Sandy Mann

Thank you for the prompt response Peo,

Sorry to be so dense but I assume from your answer that your formula it is a
generalised formula:

=INT(RAND()*(Highest No - Lowest No)+1000)

but you used real numbers. I tend to assume that when people use real
numbers they mean specifically those numbers and I could not see why when
99999-10000 was 89999 you had not simply used that number in the first
place.

I will have to start practising thinking BIG!

Thank you

Sandy
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top