Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 22
Default Add code to a worksheet programatically

I rarely have to post questions anymore because the use group history
has an answer for just about any question you can think of. But here's
one that I need help on. I have a workbook I call "Master.xls" with
VBA code which opens & manipulates several other workbooks. One of the
things I would like to do in each of the other books is add a
Worksheet_Change event to sheets in the workbooks. There are hundreds
of them so doing it manually isn't really an option. How can I use VBA
to add code to a worksheet module in another open workbook? Thanks a
lot gurus.

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 22
Default Add code to a worksheet programatically

e.g. let's say the code was:

Sub Worksheet_Change(ByVal Target As Excel.Range)
MsgBox Target
End Sub

(although it's much longer than that)

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 7,247
Default Add code to a worksheet programatically

See www.cpearson.com/excel/vbe.htm for details and examples.


"Dave B" wrote in message
oups.com...
I rarely have to post questions anymore because the use group
history
has an answer for just about any question you can think of.
But here's
one that I need help on. I have a workbook I call "Master.xls"
with
VBA code which opens & manipulates several other workbooks.
One of the
things I would like to do in each of the other books is add a
Worksheet_Change event to sheets in the workbooks. There are
hundreds
of them so doing it manually isn't really an option. How can I
use VBA
to add code to a worksheet module in another open workbook?
Thanks a
lot gurus.



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
Add a Button Programatically plus code jlclyde Excel Discussion (Misc queries) 1 December 9th 08 04:29 PM
Delete Code Modules Programatically blatham Excel Discussion (Misc queries) 1 February 3rd 06 05:38 PM
Programatically saving workbook (or worksheet) without the code Hugh Excel Programming 4 October 22nd 04 12:03 AM
Deleting macro code programatically Terry Lowe[_3_] Excel Programming 1 September 1st 04 02:30 AM
Removing VBA Code (programatically) Marnie R Excel Programming 1 February 13th 04 01:02 AM


All times are GMT +1. The time now is 04:17 PM.

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"