Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 204
Default run sub when one cell is changed

I know i can run private subs based on something like this

Private Sub Worksheet_Change(ByVal Target As Range)

if target.address = "c20" then
.........

But in the name of efficiency is there a way to name a sub so that it is not
even activated unless a specific cell is changed.

Thanks
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 204
Default run sub when one cell is changed

sorry for the double post but i am having trouble posting. I keep getting the
service is temporarily unavailable messages.



"NDBC" wrote:

I know i can run private subs based on something like this

Private Sub Worksheet_Change(ByVal Target As Range)

if target.address = "c20" then
........

But in the name of efficiency is there a way to name a sub so that it is not
even activated unless a specific cell is changed.

Thanks

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,565
Default run sub when one cell is changed

The short answer is no. Something has to send a signal that the macro needs
to run. That something is an event that Excel can detect. Then something
has to tell Excel what to do after that event is detected. That is the VBA
code in this case. The name of the macro for Worksheet_Change is a
predefined constant that tells Excel to react to changes in the worksheet
that the code underlies. So it all ties together. The problem lies in
detecting the change, without using the change event.


"NDBC" wrote in message
...
I know i can run private subs based on something like this

Private Sub Worksheet_Change(ByVal Target As Range)

if target.address = "c20" then
........

But in the name of efficiency is there a way to name a sub so that it is
not
even activated unless a specific cell is changed.

Thanks



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
Log who last changed a cell in a row...(incl Multi-Cell changes) MikeZz Excel Programming 9 February 5th 09 10:33 PM
Format changed when the details in cell changed angel Excel Worksheet Functions 9 July 15th 08 12:36 AM
Can Comment in a cell be changed as the content in another cell ?? Amit Kumar Baidyaka Excel Discussion (Misc queries) 3 January 10th 07 03:35 AM
if cell has been changed... user Excel Worksheet Functions 2 January 11th 06 07:18 PM
in vba what command is used to determine if a particular cell on a particular sheet changed? some kind of event? how to get the old and new value of the cell? Daniel Excel Worksheet Functions 1 June 23rd 05 07:53 PM


All times are GMT +1. The time now is 11:15 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"