Bjr,
un exemple ...
' cocher la réference Microsoft Visual Basic for Applications Extensibility 5.3
With ActiveWorkbook.VBProject.VBComponents(Worksheets("nom_de_la_feuille").CodeName).CodeModule
ligne = .CountOfLines
.InsertLines ligne + 1, "Private Sub Worksheet_Change(ByVal Target As Range)"
.InsertLines ligne + 2, "If Not Intersect(Target, Range(""A1"")) Is Nothing Then"
.InsertLines ligne + 3, "'_______"
.InsertLines ligne + 4, "End If"
.InsertLines ligne + 5, "End Sub"
End With