Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 10,593
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,355
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default 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
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
Run Event Code In General Module Who I Am Excel Programming 2 April 26th 06 07:26 PM
Where?Worksheet code module or Worksheet_SelectionChange event han Kenzie Excel Worksheet Functions 4 January 30th 06 09:41 PM
Run worksheet module code from workbook module? keithb Excel Programming 1 August 14th 05 04:04 AM
Updating form labels from code in a module news.verizon.net[_2_] Excel Programming 2 October 29th 03 04:03 AM


All times are GMT +1. The time now is 09:25 AM.

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

About Us

"It's about Microsoft Excel"