How to do VB random function ,example is

如何產生VB無重複的亂數,程式碼如下

Dim MyValue As Integer
MyValue = Int((6 * Rnd) + 1)    ' Generate random value between 1 and 6.


來源

https://docs.microsoft.com/zh-tw/office/vba/language/reference/user-interface-help/rnd-function

參考資料 亂數產生器:Random 與 RNGCryptoServiceProvider

http://www.cnblogs.com/mrlen/archive/2010/06/09/1754441.html

arrow
arrow
    文章標籤
    Rnd VB 亂數
    全站熱搜

    JL8051 發表在 痞客邦 留言(0) 人氣()