Static Random

The function =RAND() can be very useful for creating random numbers, but it constantly recalculates. What if you need random numbers, but don't want them to change constantly? The following function places a random number, but the number changes only if you force the cell to recalculate, as shown in Figure 4.19. StaticRAND ()

There are no arguments for this function.

Function StaticRAND() As Double Randomize STATICRAND = Rnd End Function

Figure 4.19

Produce random numbers not quite so volatile.

0 0

Post a comment