samedi 9 janvier 2021

i would like your help! in vba and userform

I built USERFORM and I can not find how to create two random numbers between 1 and the number selected by the SpinButton I made and after that it will display in the Label the question created from the first number, the selected action and the second number I would love ideas!

Private Sub CommandButton1_Click()

If ListBox1 Is False Then
MsgBox "you need to choose!"

End If


End Sub

Private Sub SpinButton1_Change()

TextBox1.Value = SpinButton1.Value

End Sub

Private Sub UserForm_Initialize()

ListBox1.AddItem "+"
    ListBox1.AddItem "-"
    ListBox1.AddItem "/"
    ListBox1.AddItem "*"
    
    
End Sub

Sub RandomNum()
Dim randi As Integer


WorksheetFunction.Max(b) = TextBox1.Value
randi = WorksheetFunction.RandBetween(a, b)

End Sub



Aucun commentaire:

Enregistrer un commentaire