Gruppe
VBE
Problem
Wie kann ich eine aufgerufene Sub-Routine nach dem Aufruf löschen?
ClassModule: Tabelle1
Private Sub CommandButton1_Click()
Call AufrufUndLoeschen
End Sub
StandardModule: basMain
Sub Meldung()
MsgBox "Hallo " & Application.UserName
End Sub
Sub AufrufUndLoeschen()
Dim iStart As Integer, iLen As Integer
Call Meldung
With ThisWorkbook.VBProject.VBComponents("basMain").CodeModule
iStart = .ProcBodyLine("Meldung", 0)
iLen = .ProcCountLines("Meldung", 0)
.DeleteLines iStart, iLen
End With
End Sub