set safe off oE = GETOBJECT(,'excel.application') ** create a table with the module names in it ** search for sub routines in the memo of each module macCode create table mac (mnum n(5) , mname c(40), mcode m(4)) sele mac WITH oe.ActiveWorkBook.VbProject For i = 1 TO .VBComponents.count mmname = .VBComponents[i].name go bott insert blank go bott repl mname with mmname repl mnum with i macName = .VBComponents[i].name macCode = .VBComponents[macName].codemodule.lines(1,100000) repl mcode with macCode EndFor EndWith go top browresources: