Thread
:
Create muliple event procedures via VBA
View Single Post
#
2
Posted to microsoft.public.excel.programming
Nigel[_2_]
external usenet poster
Posts: 735
Create muliple event procedures via VBA
Not sure I understand what you are asking in relation to the code you have
posted.
Worksheet_Change events are triggered when a worksheet content changes, your
code suggests adding module code.
It might be better to describe what you intend to do?
--
Regards,
Nigel
"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
Reply With Quote
Nigel[_2_]
View Public Profile
Find all posts by Nigel[_2_]