I HAVE NO CLUE IF THIS WILL WORK FENRIS SINCE I HAVE NEVER TRIED IT.
Sub Export_CodeModule()
Dim wbExport As Workbook
Dim CodeLines$
With ThisWorkbook.VBProject.VBComponents("modExport"

.CodeModule
' Initialize a string variable for the VBA code text in the
' original module
CodeLines$ = .Lines(1, .CountOfLines)
End With
With wbExport.VBProject.VBComponents
' The value of 1 is the equivalent of the vb constant for
' vbext_ct_StdModule (standard module - the type of component
' to be added)
.Add 1
With .Item(.Count).CodeModule
' Delete any code in the new module (such as an
' Option Explicit declaration statement)
.DeleteLines 1, .CountOfLines
' "Paste" the code
.AddFromString CodeLines$
End With
End With
End Sub
This initializes a string variable with the contents of a module named modExport in the originating workbook. In the destination workbook, represented by the wbExport object variable, a new module is added and the contents are written to it.
Note the statement:
.DeleteLines 1, .CountOfLines
This compensates for a declaration that can automatically appear at the top of a new module. For instance, if the user has the Require Variable Declaration option turned on (an excellent practice), then unless you explicitly delete all lines in the fresh module, it could produce an error from having Option Explicit twice.
--------------------------------------------------------------------------------
Now that you've added a new module into your target workbook (wbExport), how do you name it ?
Since a new module comes in as "Module1", the following procedure will usually handle the job.
Sub RenameModule1()
Dim vbm
For Each vbm In wbExport.VBProject.VBComponents
With vbm
If .Name = "Module1" Then .Name = "NewModuleName"
End With
Next vbm
End Sub
If you have a project in which for some reason the new module isn't created as "Module1", you can take the following approach:
Read all the existing module names into an array.
Create the new module.
Find which name isn't present in your array of names.
Rename that module.