Sub Ajoute_Code()
Dim Ws As Worksheet
Dim VBComp As VBComponent
Dim x As Integer
For Each Ws In ThisWorkbook.Worksheets
Set VBComp = ThisWorkbook.VBProject.VBComponents(Ws.CodeName)
With VBComp.CodeModule
x = .CountOfLines
.InsertLines x + 1, "Private Sub Worksheet_SelectionChange(ByVal Target As Range)"
.InsertLines x + 2, "If Not Application.Intersect( Target, Range (""P7"")) Is Nothing Then "
.InsertLines x + 3, "End If"
.InsertLines x + 4, "End Sub"
End With
Next
End Sub