Oui excuse moi, le module que je veux faire marcher s'ouvre lorsque l'on clique sur le bouton valider de l'userform6 avec la fonction "call plafond" (mon module s'appelle "plafond") :
Private Sub CommandButton1_Click()
If UserForm6.TextBox1.Text = "" Or UserForm6.DTPicker1.Value = "" Or UserForm6.ComboBox1.Value = "<Selectionnez>" Then
MsgBox "Attention !" & Chr(10) & "Vous n'avez pas tout saisi"
Exit Sub
Else
End If
Range("A29").End(xlUp).Offset(1, 0).Value = UserForm6.DTPicker1.Value
Range("B29").End(xlUp).Offset(1, 0).Value = UserForm6.ComboBox1.Value
Range("C29").End(xlUp).Offset(1, 0).Value = UserForm6.TextBox2.Value
Range("D29").End(xlUp).Offset(1, 0).Value = UserForm6.TextBox3.Value
Range("F29").End(xlUp).Offset(1, 0).Value = UserForm6.TextBox5.Value
Range("N29").End(xlUp).Offset(1, 0).Value = UserForm6.TextBox1.Value
UserForm6.ComboBox1.Value = ""
UserForm6.TextBox2.Value = ""
UserForm6.TextBox3.Value = ""
UserForm6.TextBox5.Value = ""
UserForm6.TextBox1.Value = ""
Unload Me
Call plafond
End Sub
lorsque l'on clique sur valider on arrive donc sur le module avec le code suivant :
Sub plafond()
Dim plafond As Range
For Each plafond In Range("G29").End(xlUp)
If plafond = 0 Then
plafond.Interior.ColorIndex = 37
UserForm9.Show
Else
plafond.Interior.ColorIndex = 7
UserForm7.Show
End If
Next plafond
End Sub
c'est ce code la qui ne marche pas.