[B][COLOR=DarkSlateGray]Sub toto()
Dim x&, wb As Object
Sheets.Add
Set wb = ThisWorkbook 'adapter...
With wb.VBProject.VBComponents(wb.ActiveSheet.Name).CodeModule 'adapter...
x = .CountOfLines
.InsertLines x + 1, "Private Sub Worksheet_SelectionChange()"
.InsertLines x + 2, "Workbooks(" & Chr(34) & "Commande groupée phyto - fichier de suivi.xls" & Chr(34) & ").Worksheets(" & Chr(34) & "Synthèse Analyse Réponse AO" & Chr(34) & ").Select"
.InsertLines x + 3, "For i = 8 To 127"
.InsertLines x + 4, "If Cells(i, 12) = Range(" & Chr(34) & "H6" & Chr(34) & ").Value Then"
.InsertLines x + 5, "Cells(i, 9 & 10 & 11).Clear"
.InsertLines x + 6, "If Cells(i, 12) = Range(" & Chr(34) & "I6" & Chr(34) & ").Value Then"
.InsertLines x + 7, "Cells(i, 8 & 10 & 11).Clear"
.InsertLines x + 8, "If Cells(i, 12) = Range(" & Chr(34) & "J6" & Chr(34) & ").Value Then"
.InsertLines x + 9, "Cells(i, 8 & 9 & 11).Clear"
.InsertLines x + 10, "If Cells(i, 12) = Range(" & Chr(34) & "K6" & Chr(34) & ").Value Then"
.InsertLines x + 11, "Cells(i, 8 & 9 & 10).Clear"
.InsertLines x + 12, "End If"
.InsertLines x + 13, "End If"
.InsertLines x + 14, "End If"
.InsertLines x + 15, "End If"
.InsertLines x + 16, "Next i"
.InsertLines x + 17, "End Sub"
End With
End Sub[/COLOR][/B]