您好,今天小编胡舒来为年夜家解答以上的题目。随机抽号器小法式,随机抽号相信良多小火伴还不知道,此刻让我们一路来看看吧!
1、Dim stmp As String Dim k As IntegerPrivate Sub Form_Load()k = 0End SubPrivate Sub Command5_Click()Dim s1 As String, s As Integer Randomize Time()If stmp = "" Then stmp = ","Do While k < 12 s = Int(Rnd * (12 - 1 + 1) + 1) If InStr(1, stmp, "," & s & ",") = 0 Then k = k + 1 Exit Do End IfLoopIf s <> 0 Thenstmp = stmp & s & ","Print sElseMsgBox "完了"End IfEnd Sub。
本文就为年夜家分享到这里,但愿小火伴们会喜好。