MrExcel Publishing
Your One Stop for Excel Tips & Solutions

Automatically adding macro code to existing spreadsheets

Posted by Jon Gossard on May 22, 2000 1:43 PM

I have created a custom footer which includes the full path, filename and sheetname, etc. by using the Workbook_BeforePrint subroutine. All my new spreadsheets already contain the custom footer but I would like to update all of my existing spreadsheets with the macro code as well. Does anyone know how to add macro code to a spreadsheet without cutting and pasting it in?!? I'm trying to write something in VBScript that will open each spreadsheet, add the code, save the file and move on to the next file. I'm relatively new at Excel so thank you for any help you can give me!

Posted by Ivan Moala on May 22, 2000 2:01 PM

Hi Jon
Have a look @ my answer to the following
Importing a CLS file into a macro. - Rich Finn 12:09:45 5/12/100 (1)

PLUS look @ Chips site (Excellent site)