导读 您好,今天小编胡舒来为大家解答以上的问题。1到50随机抽号,随机抽号相信很多小伙伴还不知道,现在让我们一起来看看吧!1、Dim stmp As S...

您好,今天小编胡舒来为大家解答以上的问题。1到50随机抽号,随机抽号相信很多小伙伴还不知道,现在让我们一起来看看吧!

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。

本文就为大家分享到这里,希望小伙伴们会喜欢。