Autres transférer les valeurs de userform vers la feuil1

medlight

XLDnaute Junior
Bonjour à tous svp quelqu'un peut m'aider pour ce fichier exemple comment faire pour transférer les valeurs saisis sur userform vers la feuil1 quand je clique sur valider et merci d'avance
 

Pièces jointes

  • test.xlsm
    15.7 KB · Affichages: 4

Lolote83

XLDnaute Barbatruc
Re bonjour,
Sur le même bouton, je ne sais pas.
Par contre, sur un autre cela donnerait

Pas testé en direct.

VB:
Private Sub CommandButton2_Click()
    With Sheets("Feuil1")
        TextBox1.Value =.[G7]
        TextBox2.Value =.[G9]
        TextBox3.Value =.[G11]
        ComboBox1.Value = .[G13]
    End With
End Sub
@+ Lolote83
 

medlight

XLDnaute Junior
Bonjour mon ami j'ai appliqué tous ce que vous dites et ca marche bien merci bcp , j'ai un autre point si vous voulez m'aider c'est pour checkbox et optionbutton. la question dans le fichier
 

Pièces jointes

  • test.xlsm
    19.5 KB · Affichages: 3

Lolote83

XLDnaute Barbatruc
Bonjour

Code:
Private Sub CommandButton1_Click()
    With Sheets("Feuil1")
        .[G7] = TextBox1.Value
        .[G9] = TextBox2.Value
        .[G11] = TextBox3.Value
        .[G13] = ComboBox1.Value
        
        TextBox4.Value = .[O7]
        TextBox5.Value = .[O9]
        TextBox6.Value = .[O11]
        
        '--------------------------- Pour les cases à cocher
        If CheckBox1 = True Then
            .[G17] = "Oui"
        Else
            .[G17] = "Non"
        End If
        
        '--------------------------- Pour les boutons Option
        If OptionButton1 = True Then
            .[G19] = "1"
        Else
            .[G19] = "2"
        End If
    End With
End Sub

Private Sub CheckBox1_Click()
    '----------------------------------- CASE A COCHER
    With Sheets("Feuil1")
        If CheckBox1 = True Then
            .[G17] = "Oui"
        Else
            .[G17] = "Non"
        End If
    End With
End Sub


Private Sub OptionButton1_Click()
    '----------------------------------- BOUTON OPTION 1
    With Sheets("Feuil1")
        If OptionButton1 = True Then
            .[G19] = "1"
        Else
            .[G19] = "2"
        End If
    End With
End Sub

Private Sub OptionButton2_Click()
    '----------------------------------- BOUTON OPTION 2
    With Sheets("Feuil1")
        If OptionButton2 = True Then
            .[G19] = "2"
        Else
            .[G19] = "1"
        End If
    End With
End Sub

@+ Lolote83
 

Statistiques des forums

Discussions
312 273
Messages
2 086 693
Membres
103 372
dernier inscrit
BibiCh