سلام از این کد میتونی استفاده کنی .


Private Sub Command1_Click()

Dim random As Integer

random = Int(Rnd * 7)
MsgBox random

End Sub