Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Generate Random Number

Status
Not open for further replies.

cantona

Technical User
May 20, 2001
121
GB
I would like to write a formula which would generate a two digit random number to append onto an exiting text field.

eg.

Test67
Test99

Does anyone know how i could do this?
 
You can use the Rnd() function. You can get more info on it in help but it takes a seed number in between the parens and generates a random number between 0 and 1. Next, you can concatenate the decimal portion of the number to your text, if that is what you want, like this:

"Test" + Right(ToText(rnd(1),4),4)

~Brian
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top