Private Sub Command1_Click()'按钮一(-50,50)
Dim n1 As Long, n2 As Long, n As Long
Randomize
n1 = -50: n2 = 50
n = Int(((n2 - n1) + 1) * Rnd + n1)
Label1 = n
End Sub
Private Sub Command2_Click()'按钮二(0,99.99)
Dim n1 As Double, n2 As Double, n As Double
Randomize
n1 = 0: n2 = 99.99
n = Format((n2 - n1 + 1) * Rnd + n1, ".00")
Label1 = n
End Sub