<p>I need to generate a random integer between 1 and n (where n is a positive whole number) to use for a unit test. I don't need something overly complicated to ensure true randomness - just an old-fashioned random number.</p>

<p>How would I do that?</p>

To get a random integer value between 1 and N (inclusive) you can use the following.
```
```
CInt(Math.Ceiling(Rnd() * n)) + 1
```
```