Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Updating Worksheet Event Code Module via VBA
I have a large number of workbooks where I need to perform VBA code
maintenance. I am updating all the code in the workbooks by first deleting all existing code (modules, forms, worksheet code modules) and then import in the updated modules / forms to to each work work. I have one worksheet in each workbook ("Census") where I need to replace the existing Worksheet_Change event code. I already have the logic / process to remove all code from the workbooks and import the updated modules / forms and worksheet code module. Where I am stumped is how to import or add a updated Worksheet_Change event code moulde. Is there a way in VBA where I can import or enter the updated worksheet_change event logic for the "Census" worksheet code module? Any help would be greating appreciated!!! Patrick |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Updating Worksheet Event Code Module via VBA
You could try AddFromFile. Save the code in a text file and use this code
ActiveWorkbook.VBProject.VBComponents("ThisWorkboo k") _ .CodeModule.AddFromFile "C:\myTest\Text1.txt" The problem is that you could add an event that is already present. -- HTH Bob (there's no email, no snail mail, but somewhere should be gmail in my addy) "Patrick4" <u42287@uwe wrote in message news:817591d66e42a@uwe... I have a large number of workbooks where I need to perform VBA code maintenance. I am updating all the code in the workbooks by first deleting all existing code (modules, forms, worksheet code modules) and then import in the updated modules / forms to to each work work. I have one worksheet in each workbook ("Census") where I need to replace the existing Worksheet_Change event code. I already have the logic / process to remove all code from the workbooks and import the updated modules / forms and worksheet code module. Where I am stumped is how to import or add a updated Worksheet_Change event code moulde. Is there a way in VBA where I can import or enter the updated worksheet_change event logic for the "Census" worksheet code module? Any help would be greating appreciated!!! Patrick |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Updating Worksheet Event Code Module via VBA
This might help, but be careful!
http://www.cpearson.com/excel/vbe.aspx -- HTH, Barb Reinhardt "Patrick4" wrote: I have a large number of workbooks where I need to perform VBA code maintenance. I am updating all the code in the workbooks by first deleting all existing code (modules, forms, worksheet code modules) and then import in the updated modules / forms to to each work work. I have one worksheet in each workbook ("Census") where I need to replace the existing Worksheet_Change event code. I already have the logic / process to remove all code from the workbooks and import the updated modules / forms and worksheet code module. Where I am stumped is how to import or add a updated Worksheet_Change event code moulde. Is there a way in VBA where I can import or enter the updated worksheet_change event logic for the "Census" worksheet code module? Any help would be greating appreciated!!! Patrick |
#4
Posted to microsoft.public.excel.programming
|
|||
|
|||
Updating Worksheet Event Code Module via VBA
These didn't work for my current circumstance but I'll keep them for my
toolkit becuase they were for workbook-level events. The event logic I am trying to add is the Worksheet_Change event associated with the "Census" worksheet in each of the workbooks. -- Message posted via http://www.officekb.com |
#5
Posted to microsoft.public.excel.programming
|
|||
|
|||
Updating Worksheet Event Code Module via VBA
Using the logic from cpearson using a workbook event worked. Thanks for the
help. -- Message posted via http://www.officekb.com |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Run Event Code In General Module | Excel Programming | |||
Where?Worksheet code module or Worksheet_SelectionChange event han | Excel Worksheet Functions | |||
Run worksheet module code from workbook module? | Excel Programming | |||
Updating form labels from code in a module | Excel Programming |