Könnte sich das bitte mal jemand anschauen und mir weiterhelfen ? Danke
Das sind 3 verschiedene Makros die alle nicht mehr funktionieren ?
Warum weiß ich leider nicht :(
Sub loeschmakro()
With ActiveWorkbook.VBProject
With .VBComponents("modul1").CodeModule
.DeleteLines 1, .countoflines
End With
End With
End Sub
'-----------------------------------------------------
Sub NewModule()
Dim mdl As Object
Dim strName As String
strName = InputBox("Modulname:", , "MyNewModule")
If strName = "" Then Exit Sub
Set mdl = ThisWorkbook.VBProject.VBComponents.Add(1)
mdl.Name = strName
End Sub
'-----------------------------------------------------
Const SuchZeile = "MsgBox ""VBA macht Spaß !"""
Const NeueZeile = "MsgBox ""VBA macht großen Spaß !"""
Sub VBAZeileÄndern()
Set VBE = Application.VBE.VBProjects(1).VBComponents.Item("Modul1").CodeModule
With VBE
For x = 1 To .countoflines
i = .countoflines
If Trim(.Lines(x, 1)) = NeueZeile Then
.ReplaceLine x, SuchZeile
Exit Sub
End If
If Trim(.Lines(x, 1)) = SuchZeile Then
.ReplaceLine x, NeueZeile
Exit Sub
End If
Next x
End With
End Sub