LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default Create muliple event procedures via VBA

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
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Event procedures: who is calling? Momo[_2_] Excel Programming 2 April 22nd 06 08:12 AM
Event procedures for spreadsheet cells ? Tim Jarrett Excel Programming 1 February 28th 06 03:40 PM
many similar event procedures natanz[_2_] Excel Programming 1 November 4th 05 02:26 PM
Event Procedures in an Add-In DJB[_10_] Excel Programming 3 September 17th 05 08:11 AM
learning event procedures R.VENKATARAMAN Excel Programming 4 January 21st 05 01:09 PM


All times are GMT +1. The time now is 07:58 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"