PDA

View Full Version : Copy function from workbook to another in VBA



blackie42
07-27-2017, 03:43 PM
Hi,

Running a macro (several different routines) off one work book on another.

Workbook called 'NEWSWMacro' runs the routines on the other workbook called 'EFM'.

The content (data) of EFM changes each day which is why the macros run from the other workbook.

What I need to do is add a module to NEWSWMacro with a particular function and then copy that module/function
over to EFM workbook at the end of the main code. Is it possible?

Can anyone help with this please

thanks
Jon

Logit
07-27-2017, 04:34 PM
.
http://www.cpearson.com/Excel/VBE.aspx

Copy A Module From One Project To Another

blackie42
07-28-2017, 01:24 AM
This is very complex - can I just check which elements I need to replace

Source project = NEWSWMacro Do I replace FromVBProject with this adding "" to string?
To project = EFM Do I replace ToVBProject with this adding "" to string?
ModuleName = SumByColor replace

Any other changes I need to make

thanks
Jon