Bonjour
je suis aller au plus simple
suprime les 2 emes bouton garde en 1 seul de chaque
garde le ok1 ,nok1,clear1 ect...
dans le module de tafeuille ta feuil CL33 es
remplace la macro
Private Sub OK1_Click()
par
1 2 3 4 5 6 7 8
| Private Sub OK1_Click()
Range("f" & ActiveCell.Row & ":I" & ActiveCell.Row) = "OK"
'Range("F9") = "OK"
'Range("G9") = "OK"
'Range("H9") = "OK"
'Range("I9") = "OK"
Range("j" & ActiveCell.Row).FormulaLocal = "=aujourdhui()"
End Sub |
voila pour les bouton de la feuille
maintenant dans le module du userform"CL33validation1 tu efface tout le code et tu met ceci:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30
| Private Sub CommandButton1_Click()
If CheckBox1.Value = True Then 'Si coché ...
Range("f" & ActiveCell.Row) = "NOK"
Else 'Si non coché ...
Range("f" & ActiveCell.Row) = "OK"
End If
If CheckBox2.Value = True Then 'Si coché ...
Range("g" & ActiveCell.Row) = "NOK"
Else 'Si non coché ...
Range("g" & ActiveCell.Row) = "OK"
End If
If CheckBox3.Value = True Then 'Si coché ...
Range("h" & ActiveCell.Row) = "NOK"
Else 'Si non coché ...
Range("h" & ActiveCell.Row) = "OK"
End If
If CheckBox4.Value = True Then 'Si coché ...
Range("h" & ActiveCell.Row) = "NOK"
Else 'Si non coché ...
Range("h" & ActiveCell.Row) = "OK"
End If
Range("j" & ActiveCell.Row).FormulaLocal = "=aujourdhui()"
Unload Me 'Fermeture
End Sub |
maintenant tu fait pareil pour le deuxieme userform tu eface tout dans le module et tu met ceci:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30
| Private Sub CommandButton1_Click()
If CheckBox1.Value = True Then 'Si coché ...
Range("f" & ActiveCell.Row) = "NOK"
Else 'Si non coché ...
Range("f" & ActiveCell.Row) = "OK"
End If
If CheckBox2.Value = True Then 'Si coché ...
Range("g" & ActiveCell.Row) = "NOK"
Else 'Si non coché ...
Range("g" & ActiveCell.Row) = "OK"
End If
If CheckBox3.Value = True Then 'Si coché ...
Range("h" & ActiveCell.Row) = "NOK"
Else 'Si non coché ...
Range("h" & ActiveCell.Row) = "OK"
End If
If CheckBox4.Value = True Then 'Si coché ...
Range("i" & ActiveCell.Row) = "NOK"
Else 'Si non coché ...
Range("i" & ActiveCell.Row) = "OK"
End If
Range("j" & ActiveCell.Row).FormulaLocal = "=aujourdhui()"
Unload Me 'Fermeture
End Sub |
voila tout simplement maintenant si tu veux modifier une ligne il te suffit de selectionner la ligne sur ta grille et cliquer sur le bouton de ton choix
voili voilou
je ne l'ai pas fait pour les bouton "clear..." je te laisse mediter quand a la marcha a suivre mais tu devrais saisir la chose tres vite a mon avis
Au plaisir
Re
je dirais meme que tu a besoins aue d'un seul de tes userforms maintenant
Au plaisir
Re
je revien aussi pour souligner une erreur de taille dans ton code
tu met a la validation ceci:
Range("j" & ActiveCell.Row).FormulaLocal = "=aujourdhui()"
hors si demain tu réouvre le fichier les dates seront mis a jour automatiquement donc ne corespondront plus au dates de controles réels
donc je remplacerais par ceci:
Range("j" & ActiveCell.Row).FormulaLocal = Date
ainsi la date inscrite sera fixe
Au plaisir
veux tu que je te renvoie un exemplaire de ton fichier corrigé???
Partager