Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save ezhov-da/d15c10251a39703cabf586305d3fe098 to your computer and use it in GitHub Desktop.
Save ezhov-da/d15c10251a39703cabf586305d3fe098 to your computer and use it in GitHub Desktop.
vba генерация случайных чисел
'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