Problème de parametrage

Fermé
FMART51 Messages postés 9 Date d'inscription vendredi 8 janvier 2016 Statut Membre Dernière intervention 9 janvier 2016 - Modifié par NHenry le 9/01/2016 à 19:39
f894009 Messages postés 17185 Date d'inscription dimanche 25 novembre 2007 Statut Membre Dernière intervention 15 avril 2024 - 10 janv. 2016 à 07:22
Bonjour à tous, j'ai de nouveau un soucis désolé je ne suis pas très doué, j'ai créé un Userform avec un multi page, pour avoir un onglet Rechercher, modifier contact, un supprimer un contact et un ajouter un contact, l'onglet ajouter un contact fonctionnent mais pas les autres, si je vous joint mon code, pouvez vous me donnez un petit coup de pouce, s'il vous plait.
Dans tous les cas je vous remercie d'avance la derniere fois j'ai eu affaire a quelqu'un de super sympas qui m'a bien aider, j'espère avoir la même chance cet fois ci.

F


Code


Option Explicit

Private Sub ComboBox6_Change()
Dim prefixe As String
ComboBox9.Clear
prefixe = ComboBox6.Value
For Each D In Sheets("Contact").Range("D2", Range("D2").End(xlDown).Address)
  If c.Value = prefixe Then
 
  ComboBox5.AddItem D.Offset(0, 1).Value
  End If
Next
End Sub



Private Sub ComboBox7_Change()
Dim prefixe As String
ComboBox9.Clear
prefixe = ComboBox6.Value
For Each c In Sheets("Contact").Range("c2", Range("c2").End(xlDown).Address)
  If c.Value = prefixe Then
 
  ComboBox5.AddItem c.Offset(0, 1).Value
  End If
Next
End Sub

Private Sub ComboBox8_Change()
Sheets("Contact").Range("B2:M300").Interior.Color = xlNone

Dim prefixe As String, nom As String

prefixe = ComboBox6.Value: nom = ComboBox9.Value

For Each c In Sheets("Contact").Range("C2", Range("C2").End(xlDown).Address)
 If c = prefixe And c.Offset(0, 1) = nom Then
  Sheets("Contact").Range("B" & c.Row & ":M" & c.Row).Interior.ColorIndex = 4 
    TextBox45 = c.Offset(0, 1)
    TextBox44 = c.Offset(0, 2)
  TextBox26 = c.Offset(0, 3)
  TextBox27 = c.Offset(0, 4)
  TextBox28 = c.Offset(0, 5)
  TextBox29 = c.Offset(0, 6)
  TextBox30 = c.Offset(0, 7)
  TextBox31 = c.Offset(0, 8)
  TextBox32 = c.Offset(0, 9)
  TextBox33 = c.Offset(0, 10)
 End If
Next
End Sub

Private Sub ComboBox9_Change()

Sheets("Contact").Range("B2:M300").Interior.Color = xlNone

Dim prefixe As String, nom As String

prefixe = ComboBox6.Value: nom = ComboBox9.Value

For Each c In Sheets("Contact").Range("D2", Range("D2").End(xlDown).Address)
 If c = prefixe And c.Offset(0, 1) = nom Then
  Sheets("Contact").Range("B", c.Row, "M" & c.Row).Interior.ColorIndex = 4     TextBox45 = c.Offset(0, 1)
  TextBox44 = c.Offset(0, 2)
  TextBox26 = c.Offset(0, 3)
  TextBox27 = c.Offset(0, 4)
  TextBox28 = c.Offset(0, 5)
  TextBox29 = c.Offset(0, 6)
  TextBox30 = c.Offset(0, 7)
  TextBox31 = c.Offset(0, 8)
  TextBox32 = c.Offset(0, 9)
  TextBox33 = c.Offset(0, 10)
 End If
Next
End Sub

Private Sub CommandButton2_Click()

Sheets("Contact").Range("B" & ligne) = TextBox24
Sheets("Contact").Range("C" & ligne) = ComboBox6
Sheets("Contact").Range("D" & ligne) = ComboBox9
Sheets("Contact").Range("E" & ligne) = TextBox26
Sheets("Contact").Range("F" & ligne) = TextBox27
Sheets("Contact").Range("G" & ligne) = TextBox28
Sheets("Contact").Range("H" & ligne) = TextBox29
Sheets("Contact").Range("I" & ligne) = TextBox30
Sheets("Contact").Range("K" & ligne) = TextBox31
Sheets("Contact").Range("L" & ligne) = TextBox32
Sheets("Contact").Range("M" & ligne) = TextBox33

Unload Me

End Sub

Private Sub CommandButton4_Click()
   
   Dim L As Integer
 
   If MsgBox("Confirmez-vous l'insertion de ce nouveau contact ? ", vbYesNo, "Demande de confirmation d'ajout") = vbYes Then
   
   L = Sheets("Contact").Range("B65536").End(xlUp).Row + 1 'Pour placer le nouvel enregistrement à la première ligne du tableau non vide
     
   Range("B" & L).Value = UCase(TextBox14)
     
   Range("C" & L).Value = UCase(ComboBox5)
   
   Range("D" & L).Value = UCase(TextBox15)
   
   Range("E" & L).Value = UCase(TextBox16)
   
   Range("F" & L).Value = UCase(TextBox17)
   
   Range("G" & L).Value = UCase(TextBox18)
   
   Range("H" & L).Value = UCase(TextBox19)
   
   Range("I" & L).Value = UCase(TextBox20)
   
   Range("K" & L).Value = UCase(TextBox21)
   
   Range("L" & L).Value = UCase(TextBox22)
   
   Range("M" & L).Value = UCase(TextBox23)

  End If
  
  Unload Me ' Vide et ferme l'Userform ( formulaire)

  UserForm2.Show 'Affiche le formulaire

End Sub

Private Sub CommandButton5_Click()
Unload Me
End Sub

Private Sub CommandButton6_Click()
Unload Me
End Sub

Private Sub CommandButton7_Click()

On Error Resume Next
Dim nom As String, ligne As Long
nom = ComboBox8
With Sheets("Contact").Range("d2:" & Range("D2").End(xlDown).Address)
    Set c = .Find(nom, LookIn:=xlValues)
    ligne = c.Row
' Range("b" & ligne & ":" & "i" & ligne).Value = ""
'Range("b" & ligne & ":" & "i" & ligne).Interior.Color = xlNone

Sheets("Contact").Rows(ligne).Delete Shift:=xlUp
End With
End Sub

Private Sub CommandButton8_Click()
Unload Me
End Sub

Private Sub UserForm_Initialize()

ComboBox5.AddItem "M"
ComboBox5.AddItem "Mme"
ComboBox5.AddItem "Mlle"

End Sub

3 réponses

f894009 Messages postés 17185 Date d'inscription dimanche 25 novembre 2007 Statut Membre Dernière intervention 15 avril 2024 1 701
9 janv. 2016 à 20:04
Bonjour
Vous pourriez mettre votre fichier à disposition sans donnée sensible, ce serait plus simple pour tester
0
FMART51 Messages postés 9 Date d'inscription vendredi 8 janvier 2016 Statut Membre Dernière intervention 9 janvier 2016 1
9 janv. 2016 à 21:00
Je peux vous l'envoyer par mail si vous souhaitez
0
FMART51 Messages postés 9 Date d'inscription vendredi 8 janvier 2016 Statut Membre Dernière intervention 9 janvier 2016 1
9 janv. 2016 à 21:11
Je peux vous l'envoyer par mail si vous le souhaitez, contactez moi directement sur f.mart51@orange.fr je vous l'enverrai directement.

Merci d'avance

Et surtout merci beaucoup pour votre aide pour le code de mot de passe
0
f894009 Messages postés 17185 Date d'inscription dimanche 25 novembre 2007 Statut Membre Dernière intervention 15 avril 2024 1 701
10 janv. 2016 à 07:22
Bonjour,
Il y a les MP à défaut, mais je vous contact ce matin
0