Quantcast
Channel: Excel Help Forum - Excel Programming / VBA / Macros
Viewing all articles
Browse latest Browse all 49909

vba random numbers

$
0
0
code below is constantly generating s = 3?
even after closing excel and restarting...

also the case select is always using sortDescription even though s =3?

Code:

Private Sub UserForm_Initialize()
s = Int((4 - 1 + 1) * Rnd + 1)
Application.Volatile True


Select Case s

Case s = 1

sortA

Case s = 2

sortB

Case s = 3

sortPrice

Case Else

sortDescription

End Select


Viewing all articles
Browse latest Browse all 49909

Trending Articles