PC Review


Reply
Thread Tools Rate Thread

Can Worksheet_Change be placed somewhere "universal"?

 
 
Maury Markowitz
Guest
Posts: n/a
 
      9th Apr 2009
I have a workbook with many tabs, and the number often changes. Most
of these tabs have columns that need to call code when certain cells
change. The code in incorporated into another workbook that is always
opened.

I call the code by placing a Worksheet_Change event hander VBA macro
in every sheet. The problem is that if the macro changes, say it moves
to a different workbook or the API changes, I have to go to all of the
sheets and change the code that calls it.

Can I put this event handler somewhere else? Does the _change message
"bubble up" to some higher layer, like ThisWorkbook?

Maury
 
Reply With Quote
 
 
 
 
Per Jessen
Guest
Posts: n/a
 
      9th Apr 2009
Hi

You can use a Workbook_SheetChange event.

The code is to be in the code sheet for ThisWorkbook.

Private Sub Workbook_SheetChange(ByVal Sh As Object, ByVal Target As Range)
'Your code
End Sub

Hopes this helps.

---
Per

"Maury Markowitz" <(E-Mail Removed)> skrev i meddelelsen
news:2b7628ef-2a3a-4a42-9751-(E-Mail Removed)...
>I have a workbook with many tabs, and the number often changes. Most
> of these tabs have columns that need to call code when certain cells
> change. The code in incorporated into another workbook that is always
> opened.
>
> I call the code by placing a Worksheet_Change event hander VBA macro
> in every sheet. The problem is that if the macro changes, say it moves
> to a different workbook or the API changes, I have to go to all of the
> sheets and change the code that calls it.
>
> Can I put this event handler somewhere else? Does the _change message
> "bubble up" to some higher layer, like ThisWorkbook?
>
> Maury


 
Reply With Quote
 
Maury Markowitz
Guest
Posts: n/a
 
      9th Apr 2009
Thank you!
 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
Using "Select Case" inside Worksheet_Change() subroutine..... Robert Crandal Microsoft Excel Programming 2 22nd Nov 2009 06:34 AM
"HP Universal Printing" driver crashes explorer Ron Lowe Windows Vista Print / Fax / Scan 6 22nd Mar 2007 03:50 AM
How so I make a "Worksheet_Change Event" to show cell changes in Excel? susiecmore Microsoft Excel Programming 1 26th Apr 2006 06:41 PM
How to make two codes "Worksheet_Change" work together in same sheet code page brunces Microsoft Excel Discussion 2 3rd Nov 2004 04:53 PM
HCT11.2 - Universal Device HCT fails for "System" Class driver =?Utf-8?B?QW50aG9ueSBDb3JyaXZlYXU=?= Windows XP Logo 0 19th Jul 2004 05:09 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 11:45 PM.