Gruppe
VBE
Problem
VBA-Code soll bei Schaltflächen-Klick auskommentiert werden.
StandardModule: Modul1
Sub Meldung()
MsgBox "Hallo!"
End Sub
StandardModule: Modul2
Sub Auskommentieren()
Dim iRow As Integer
Dim sCode As String
With ThisWorkbook.VBProject.VBComponents("Modul1").CodeModule
For iRow = 1 To .CountOfLines
sCode = .Lines(iRow, 1)
.DeleteLines iRow
.InsertLines iRow, "'" & sCode
Next iRow
End With
End Sub