Formulaire

Bonjour, j'ai créé un formulaire, le problème c'est que la fusion ne se fait pas entre l'onglet "DATE DE NAISSANCE" et la cellule de la colonne "DATE DE NAISSANCE". Aussi le nom de l'agent traitant se met dan les cellules de la colonne "DATE D'ENVOI DU COURRIER ET MISE A JOUR SAGE". comment fait-on pour changer le fond du bouton formulaire , pour par exemple insérer une photo ? merci pour votre aide

Bonjour ludeaux, le forum,

Pourquoi avoir fusionné les colonnes B et C ?

Cordialement,

Bonjour,

Une correction :

Private Sub ComboBox1_Change()

End Sub

Private Sub CommandButton1_Click()
If ComboBox1.Value = "" Then
    MsgBox "Veuillez renseigner le champs 'NOM PRENOM'"
Else
    Dim lligne As Integer
    If MsgBox("Confirmez-vous l'ajout des données ?", vbYesNo, "Confirmation") = vbYes Then
    Worksheets("Feuil1").Select
    ligne = Sheets("Feuil1").Range("A456541").End(xlUp).Row + 1
    Cells(ligne, 1) = TextBox1.Value
    Cells(ligne, 2) = ComboBox1.Value
    Cells(ligne, 4) = TextBox2.Value
    Cells(ligne, 5) = TextBox3.Value
    Cells(ligne, 6) = TextBox4.Value
    Cells(ligne, 7) = TextBox5.Value
    Unload UserForm1
    UserForm1.Show
    Else
    End If
   End If
End Sub

Private Sub CommandButton2_Click()
If Not ComboBox1.Value = "" Then
  Dim no_ligne As Integer

    no_ligne = ComboBox1.ListIndex + 2
    TextBox1.Value = Cells(no_ligne, 1).Value
    ComboBox1.Value = Cells(no_ligne, 2).Value
    TextBox2.Value = Cells(no_ligne, 4).Value
    TextBox3.Value = Cells(no_ligne, 5).Value
    TextBox4.Value = Cells(no_ligne, 6).Value
    TextBox5.Value = Cells(no_ligne, 7).Value
Else
End If
End Sub

Private Sub CommandButton3_Click()
Dim modif As Integer
If Not ComboBox1.Value = "" Then
Sheets("Feuil1").Select
modif = ComboBox1.ListIndex + 2
    Cells(modif, 1) = TextBox1.Value
    Cells(modif, 2) = ComboBox1.Value
    Cells(modif, 3) = TextBox2.Value
    Cells(modif, 4) = TextBox3.Value
    Cells(modif, 5) = TextBox4.Value
    Cells(modif, 6) = TextBox5.Value
    MsgBox ("Modification effectuer")
    Else
    MsgBox ("Veuillez sélectionner le NOM PRENOM de la personne à modifier")
    Exit Sub
    End If

    Unload UserForm1
    UserForm1.Show 0
End Sub

Private Sub UserForm_Click()

End Sub

MERCI BEAUCOUP. Le bouton "MODIFIER" ne fonctionne pas correctement, c'est à dire que dès que je clique dessus. j'ai les noms qui ce décalent de la droite vers la gauche. si je change le nom dans l'onglet "agent traitant"celui-ci ce décale dans la colonne de gauche et garde le nom d'origine inscrit. A chaque fois que je veur rajouter une demande les infos saisies se mettent que dans les cellules de la première ligne.

Un essai :

Private Sub ComboBox1_Change()

End Sub

Private Sub CommandButton1_Click()
If ComboBox1.Value = "" Then
    MsgBox "Veuillez renseigner le champs 'NOM PRENOM'"
Else
    Dim lligne As Integer
    If MsgBox("Confirmez-vous l'ajout des données ?", vbYesNo, "Confirmation") = vbYes Then
    Worksheets("Feuil1").Select
    ligne = Sheets("Feuil1").Range("A456541").End(xlUp).Row + 1
    Cells(ligne, 1) = TextBox1.Value
    Cells(ligne, 2) = ComboBox1.Value
    Cells(ligne, 4) = TextBox2.Value
    Cells(ligne, 5) = TextBox3.Value
    Cells(ligne, 6) = TextBox4.Value
    Cells(ligne, 7) = TextBox5.Value
    Unload UserForm1
    UserForm1.Show
    Else
    End If
   End If
End Sub

Private Sub CommandButton2_Click()
If Not ComboBox1.Value = "" Then
  Dim no_ligne As Integer

    no_ligne = ComboBox1.ListIndex + 2
    TextBox1.Value = Cells(no_ligne, 1).Value
    ComboBox1.Value = Cells(no_ligne, 2).Value
    TextBox2.Value = Cells(no_ligne, 4).Value
    TextBox3.Value = Cells(no_ligne, 5).Value
    TextBox4.Value = Cells(no_ligne, 6).Value
    TextBox5.Value = Cells(no_ligne, 7).Value
Else
End If
End Sub

Private Sub CommandButton3_Click()
Dim modif As Integer
If Not ComboBox1.Value = "" Then
Sheets("Feuil1").Select
modif = ComboBox1.ListIndex + 2
    Cells(modif, 1) = TextBox1.Value
    Cells(modif, 2) = ComboBox1.Value
    Cells(modif, 4) = TextBox2.Value
    Cells(modif, 5) = TextBox3.Value
    Cells(modif, 6) = TextBox4.Value
    Cells(modif, 7) = TextBox5.Value
    MsgBox ("Modification effectuer")
    Else
    MsgBox ("Veuillez sélectionner le NOM PRENOM de la personne à modifier")
    Exit Sub
    End If

    Unload UserForm1
    UserForm1.Show 0
End Sub

Private Sub UserForm_Click()

End Sub

Super merci.

Faudrait voir pour les contrôles de saisie :

  • Peut être rendre tous les champs obligatoires
  • Contrôler le format de saisie également...
....

on fait comment ?

Je regarde ce soir

merci.

je ne trouve pas le code pour clignoter le bouton.

Rechercher des sujets similaires à "formulaire"