ich möchte mittels eines Makros in einer Exceltabelle ein Makro in eine andere Tabelle schreiben. Geht das?
Vielen Dank,
Micha
Sub CopyModule()
Dim sPath As String
sPath = Application.Path & "C:\"
ThisWorkbook.VBProject _
.VBComponents("basMain").Export sPath & "basMain.bas"
Workbooks.Add 1
With ActiveWorkbook.VBProject
.VBComponents.Import sPath & "basMain.bas"
.VBComponents("basMain").Name = "MyModul"
End With
Kill sPath & "\basMain.bas"
MsgBox "Modul wurde kopiert!"
End Sub