Last active
March 10, 2019 12:18
-
-
Save ezhov-da/d15c10251a39703cabf586305d3fe098 to your computer and use it in GitHub Desktop.
vba генерация случайных чисел
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
'https://www.techonthenet.com/excel/formulas/rnd.php | |
Int ((6 - 1 + 1) * Rnd + 1) | |
Result: random number between 1 and 6 | |
Int ((200 - 150 + 1) * Rnd + 150) | |
Result: random number between 150 and 200 | |
Int ((999 - 100 + 1) * Rnd + 100) | |
Result: random number between 100 and 999 | |
'For example: | |
Dim LRandomNumber As Integer | |
LRandomNumber = Int ((300 - 200 + 1) * Rnd + 200) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment