Supprime la procédure Test1 du module Feuil1 '------------------------------- Sub ClearThisWorkbookCode(ByVal NomProcédure As String, _ NomDuClasseur As String)
Dim StartLine As Long, LineCount As Long On Error Resume Next
With ThisWorkbook.VBProject.VBComponents("Feuil1").CodeModule StartLine = .ProcStartLine(NomProcédure, 0) If StartLine Then LineCount = .ProcCountLines(NomProcédure, 0) .DeleteLines StartLine, LineCount End If End With
End Sub '-------------------------------
'Pour ajouter une procédure "Sub MonAjout()" au module de la feuil1 '--------------------------- Sub AjouteLeCode()
Supprime la procédure Test1 du module Feuil1
'-------------------------------
Sub ClearThisWorkbookCode(ByVal NomProcédure As String, _
NomDuClasseur As String)
Dim StartLine As Long, LineCount As Long
On Error Resume Next
With ThisWorkbook.VBProject.VBComponents("Feuil1").CodeModule
StartLine = .ProcStartLine(NomProcédure, 0)
If StartLine Then
LineCount = .ProcCountLines(NomProcédure, 0)
.DeleteLines StartLine, LineCount
End If
End With
End Sub
'-------------------------------
'Pour ajouter une procédure "Sub MonAjout()" au module de la feuil1
'---------------------------
Sub AjouteLeCode()
Supprime la procédure Test1 du module Feuil1 '------------------------------- Sub ClearThisWorkbookCode(ByVal NomProcédure As String, _ NomDuClasseur As String)
Dim StartLine As Long, LineCount As Long On Error Resume Next
With ThisWorkbook.VBProject.VBComponents("Feuil1").CodeModule StartLine = .ProcStartLine(NomProcédure, 0) If StartLine Then LineCount = .ProcCountLines(NomProcédure, 0) .DeleteLines StartLine, LineCount End If End With
End Sub '-------------------------------
'Pour ajouter une procédure "Sub MonAjout()" au module de la feuil1 '--------------------------- Sub AjouteLeCode()