Bonjour,
Je voudrais savoir comment mettre une valeur numérique dans une variable et afficher cette variable dans un textbox sans passer par une cellule excel.
tu declares wr comme etant une variable long il te faut donc utiliser l'instruction set pour initialiser cette variable :
Dim wr As Long Set wr = 2 'par exemple
Private Sub OptionButton1_Click()
If Me.OptionButton1 Then UserForm1.TextBox9.Text = 2
End Sub
Private Sub OptionButton2_Click()
If Me.OptionButton2 Then UserForm1.TextBox9.Text = 3
End Sub
Une variante
Code:
Private Sub OptionButton1_Click()
TextBox9.Text = IIf(OptionButton1 = True, 2, vbNullString)
End Sub
Private Sub OptionButton2_Click()
TextBox9.Text = IIf(OptionButton2 = True, 3, vbNullString)
End sub
Public K As Long
Private Sub OptionButton1_Click()
K = IIf(OptionButton1 = True, 2, vbNullString)
TextBox9.Text = K
End Sub
Private Sub OptionButton2_Click()
K = IIf(OptionButton2 = True, 3, vbNullString)
TextBox9.Text = K
End Sub
Peux-tu mettre un petit fichier exemple... (ZIPPE, clic droit dans l'explorateur et Envoyer vers/Dossier compressé), et tu nous l'envoies, en bas du post, Gérer les pièces jointe, le rechercher sur ton disque et Uploader...