• Hi All

    Please note that at the Chandoo.org Forums there is Zero Tolerance to Spam

    Post Spam and you Will Be Deleted as a User

    Hui...

  • When starting a new post, to receive a quicker and more targeted answer, Please include a sample file in the initial post.

VBA code to Generate 6 Digit ID number

@sn152
Use Randomize before Rnd (this not help Your challenge)
Do You mean that sometimes You get '5 digit number' like 12345?
But You would like to get only like
123456?
You could also get '1 digit number' like
1.
All those (1, 12345 & 123456) are correct.
Have You tried to 'format' Your r-value,
to look like '000000'?
Then it would always looks like '6 digit number' -
beginning zeros matters too.
Screen Shot 2017-03-29 at 09.51.29.png
 

Hi !

At child level ! Six digit number : from 100 000 to 999 999 …
So Fix(Rnd * 900000) + 100000 !
 
Back
Top