Create muliple event procedures via VBA
Derek
Have you thought about using a Private Sub Workbook_SheetChange event
macro? That would be only one macro and it would fire whenever any cell in
the entire workbook changes content. The macro identifies the target sheet
as well as the target cell. Just a thought. HTH Otto
"Derek Brussels" wrote in message
...
Hello,
I want a VBA procedure to create a Worksheet_change procedure for each
sheet
in a workbook.
I have tried many things, but each time Excel and VBA are shut down.
One Works fine:
ActiveWorkbook.VBProject.VBComponents(ActiveSheet. CodeName).CodeModule.AddFromFile
"C:\code.txt"
Muliple does NOT work:
For each sheet in activeworkbook.sheets
sheet.activate
ActiveWorkbook.VBProject.VBComponents(ActiveSheet. CodeName).CodeModule.AddFromFile
"C:\code.txt"
next
Anyone?
thank you,
Derek
|