PC Review


Reply
Thread Tools Rate Thread

Call Worksheet_Change macro in another worksheet

 
 
=?Utf-8?B?RnJlZGR5?=
Guest
Posts: n/a
 
      29th Oct 2006
Hi,

I have two worksheets, the first stores results from various tests. One test
is performed on every tenth specimen. When the data from this every tenth
test changes, a Worksheet_Change macro runs and pulls the data from the last
30 specimens into another worksheet where I analyze the data using a chart
and various SPC tests.

I have another Worksheet_Change macro in the SPC worksheet that will run
when the 30 test results are updated (manually). If the results fail any of
the SPC tests, an email is automatically sent.



My question - Is there a way to tie run the Worksheet_Change macro from the
SPC Worksheet at the bottom of the original Worksheet_Change? I have seen the
post "How to call a macro from another worksheet" on 7/12/06, but if I move
my Worksheet_Change macro from the SPC Worksheet to a General Module, it no
longer works when I manually update the data in teh SPC Worksheet.

Any ideas? Is it even possible to call one Worksheet_Change macro from
another Worksheet_Change macro?

Thanks,

Freddy



 
Reply With Quote
 
 
 
 
Don Guillett
Guest
Posts: n/a
 
      29th Oct 2006
How about putting the macro in a regular module and calling it from the
worksheet_change event OR the other macro?

--
Don Guillett
SalesAid Software
(E-Mail Removed)
"Freddy" <(E-Mail Removed)> wrote in message
news:2FC95372-568A-4B86-AF4A-(E-Mail Removed)...
> Hi,
>
> I have two worksheets, the first stores results from various tests. One
> test
> is performed on every tenth specimen. When the data from this every tenth
> test changes, a Worksheet_Change macro runs and pulls the data from the
> last
> 30 specimens into another worksheet where I analyze the data using a chart
> and various SPC tests.
>
> I have another Worksheet_Change macro in the SPC worksheet that will run
> when the 30 test results are updated (manually). If the results fail any
> of
> the SPC tests, an email is automatically sent.
>
>
>
> My question - Is there a way to tie run the Worksheet_Change macro from
> the
> SPC Worksheet at the bottom of the original Worksheet_Change? I have seen
> the
> post "How to call a macro from another worksheet" on 7/12/06, but if I
> move
> my Worksheet_Change macro from the SPC Worksheet to a General Module, it
> no
> longer works when I manually update the data in teh SPC Worksheet.
>
> Any ideas? Is it even possible to call one Worksheet_Change macro from
> another Worksheet_Change macro?
>
> Thanks,
>
> Freddy
>
>
>



 
Reply With Quote
 
=?Utf-8?B?RnJlZGR5?=
Guest
Posts: n/a
 
      29th Oct 2006
Hi Don,

I've already tried putting the second Worksheet_Change event and the send
email macro that goes with it module 1. I call to it at the bottom of my
first Worksheet_Change with:

Application.Run "75851_Plasticity_Last_30!Worksheet_Change"

When I run the first Worksheet_Change, I receive the error: The macro cannot
be found.

Any thoughts?

Thanks,

Freddy



"Don Guillett" wrote:

> How about putting the macro in a regular module and calling it from the
> worksheet_change event OR the other macro?
>
> --
> Don Guillett
> SalesAid Software
> (E-Mail Removed)
> "Freddy" <(E-Mail Removed)> wrote in message
> news:2FC95372-568A-4B86-AF4A-(E-Mail Removed)...
> > Hi,
> >
> > I have two worksheets, the first stores results from various tests. One
> > test
> > is performed on every tenth specimen. When the data from this every tenth
> > test changes, a Worksheet_Change macro runs and pulls the data from the
> > last
> > 30 specimens into another worksheet where I analyze the data using a chart
> > and various SPC tests.
> >
> > I have another Worksheet_Change macro in the SPC worksheet that will run
> > when the 30 test results are updated (manually). If the results fail any
> > of
> > the SPC tests, an email is automatically sent.
> >
> >
> >
> > My question - Is there a way to tie run the Worksheet_Change macro from
> > the
> > SPC Worksheet at the bottom of the original Worksheet_Change? I have seen
> > the
> > post "How to call a macro from another worksheet" on 7/12/06, but if I
> > move
> > my Worksheet_Change macro from the SPC Worksheet to a General Module, it
> > no
> > longer works when I manually update the data in teh SPC Worksheet.
> >
> > Any ideas? Is it even possible to call one Worksheet_Change macro from
> > another Worksheet_Change macro?
> >
> > Thanks,
> >
> > Freddy
> >
> >
> >

>
>
>

 
Reply With Quote
 
=?Utf-8?B?SkxHV2hpeg==?=
Guest
Posts: n/a
 
      29th Oct 2006
Freddy, you have me confused. If you have a Worksheet_Change() macro, would
it not automatically run if you make a worksheet change? Why do you need to
call it from another sheet if it is tied to the sheet where the change
occurs? Is sounds to me like you are looking for a different kind of macro
that will be initiated based on a condition which can be controlled with an
"If ... Then ... Else" statement. What do you think, Don?

"Freddy" wrote:

> Hi Don,
>
> I've already tried putting the second Worksheet_Change event and the send
> email macro that goes with it module 1. I call to it at the bottom of my
> first Worksheet_Change with:
>
> Application.Run "75851_Plasticity_Last_30!Worksheet_Change"
>
> When I run the first Worksheet_Change, I receive the error: The macro cannot
> be found.
>
> Any thoughts?
>
> Thanks,
>
> Freddy
>
>
>
> "Don Guillett" wrote:
>
> > How about putting the macro in a regular module and calling it from the
> > worksheet_change event OR the other macro?
> >
> > --
> > Don Guillett
> > SalesAid Software
> > (E-Mail Removed)
> > "Freddy" <(E-Mail Removed)> wrote in message
> > news:2FC95372-568A-4B86-AF4A-(E-Mail Removed)...
> > > Hi,
> > >
> > > I have two worksheets, the first stores results from various tests. One
> > > test
> > > is performed on every tenth specimen. When the data from this every tenth
> > > test changes, a Worksheet_Change macro runs and pulls the data from the
> > > last
> > > 30 specimens into another worksheet where I analyze the data using a chart
> > > and various SPC tests.
> > >
> > > I have another Worksheet_Change macro in the SPC worksheet that will run
> > > when the 30 test results are updated (manually). If the results fail any
> > > of
> > > the SPC tests, an email is automatically sent.
> > >
> > >
> > >
> > > My question - Is there a way to tie run the Worksheet_Change macro from
> > > the
> > > SPC Worksheet at the bottom of the original Worksheet_Change? I have seen
> > > the
> > > post "How to call a macro from another worksheet" on 7/12/06, but if I
> > > move
> > > my Worksheet_Change macro from the SPC Worksheet to a General Module, it
> > > no
> > > longer works when I manually update the data in teh SPC Worksheet.
> > >
> > > Any ideas? Is it even possible to call one Worksheet_Change macro from
> > > another Worksheet_Change macro?
> > >
> > > Thanks,
> > >
> > > Freddy
> > >
> > >
> > >

> >
> >
> >

 
Reply With Quote
 
=?Utf-8?B?RnJlZGR5?=
Guest
Posts: n/a
 
      29th Oct 2006
Yes, I thought that it would automatically run when I started writing this
macro series.

The first Worksheet_Change macro on the first workbook works fine. The
second worksheet (where the first worksheet_change macro stores the last 30
data points) also has a Worksheet_Change macro that looks at certain test I
have set up. If the data passes the test, I have and IF formula issue a value
of 0, if it fails 1.

The second Worksheet_Change macro (that is attached to the second worksheet)
looks at the values from the If statement - if they are greater than 0. The
macro should send an email.

If I go to the second worksheet, and MANUALLY change the last datapoint so
the tests will fail, the email gets sent. It doesn't when I let the
Worksheet_Change macro from the original worksheet pull the data over to the
second worksheet.

"JLGWhiz" wrote:

> Freddy, you have me confused. If you have a Worksheet_Change() macro, would
> it not automatically run if you make a worksheet change? Why do you need to
> call it from another sheet if it is tied to the sheet where the change
> occurs? Is sounds to me like you are looking for a different kind of macro
> that will be initiated based on a condition which can be controlled with an
> "If ... Then ... Else" statement. What do you think, Don?
>
> "Freddy" wrote:
>
> > Hi Don,
> >
> > I've already tried putting the second Worksheet_Change event and the send
> > email macro that goes with it module 1. I call to it at the bottom of my
> > first Worksheet_Change with:
> >
> > Application.Run "75851_Plasticity_Last_30!Worksheet_Change"
> >
> > When I run the first Worksheet_Change, I receive the error: The macro cannot
> > be found.
> >
> > Any thoughts?
> >
> > Thanks,
> >
> > Freddy
> >
> >
> >
> > "Don Guillett" wrote:
> >
> > > How about putting the macro in a regular module and calling it from the
> > > worksheet_change event OR the other macro?
> > >
> > > --
> > > Don Guillett
> > > SalesAid Software
> > > (E-Mail Removed)
> > > "Freddy" <(E-Mail Removed)> wrote in message
> > > news:2FC95372-568A-4B86-AF4A-(E-Mail Removed)...
> > > > Hi,
> > > >
> > > > I have two worksheets, the first stores results from various tests. One
> > > > test
> > > > is performed on every tenth specimen. When the data from this every tenth
> > > > test changes, a Worksheet_Change macro runs and pulls the data from the
> > > > last
> > > > 30 specimens into another worksheet where I analyze the data using a chart
> > > > and various SPC tests.
> > > >
> > > > I have another Worksheet_Change macro in the SPC worksheet that will run
> > > > when the 30 test results are updated (manually). If the results fail any
> > > > of
> > > > the SPC tests, an email is automatically sent.
> > > >
> > > >
> > > >
> > > > My question - Is there a way to tie run the Worksheet_Change macro from
> > > > the
> > > > SPC Worksheet at the bottom of the original Worksheet_Change? I have seen
> > > > the
> > > > post "How to call a macro from another worksheet" on 7/12/06, but if I
> > > > move
> > > > my Worksheet_Change macro from the SPC Worksheet to a General Module, it
> > > > no
> > > > longer works when I manually update the data in teh SPC Worksheet.
> > > >
> > > > Any ideas? Is it even possible to call one Worksheet_Change macro from
> > > > another Worksheet_Change macro?
> > > >
> > > > Thanks,
> > > >
> > > > Freddy
> > > >
> > > >
> > > >
> > >
> > >
> > >

 
Reply With Quote
 
=?Utf-8?B?RnJlZGR5?=
Guest
Posts: n/a
 
      29th Oct 2006
Can two macros run at the same time? I think it could be possible that the
first hasn't completely finished running when the second is starting.

Thanks,

Freddy


"Freddy" wrote:

> Yes, I thought that it would automatically run when I started writing this
> macro series.
>
> The first Worksheet_Change macro on the first workbook works fine. The
> second worksheet (where the first worksheet_change macro stores the last 30
> data points) also has a Worksheet_Change macro that looks at certain test I
> have set up. If the data passes the test, I have and IF formula issue a value
> of 0, if it fails 1.
>
> The second Worksheet_Change macro (that is attached to the second worksheet)
> looks at the values from the If statement - if they are greater than 0. The
> macro should send an email.
>
> If I go to the second worksheet, and MANUALLY change the last datapoint so
> the tests will fail, the email gets sent. It doesn't when I let the
> Worksheet_Change macro from the original worksheet pull the data over to the
> second worksheet.
>
> "JLGWhiz" wrote:
>
> > Freddy, you have me confused. If you have a Worksheet_Change() macro, would
> > it not automatically run if you make a worksheet change? Why do you need to
> > call it from another sheet if it is tied to the sheet where the change
> > occurs? Is sounds to me like you are looking for a different kind of macro
> > that will be initiated based on a condition which can be controlled with an
> > "If ... Then ... Else" statement. What do you think, Don?
> >
> > "Freddy" wrote:
> >
> > > Hi Don,
> > >
> > > I've already tried putting the second Worksheet_Change event and the send
> > > email macro that goes with it module 1. I call to it at the bottom of my
> > > first Worksheet_Change with:
> > >
> > > Application.Run "75851_Plasticity_Last_30!Worksheet_Change"
> > >
> > > When I run the first Worksheet_Change, I receive the error: The macro cannot
> > > be found.
> > >
> > > Any thoughts?
> > >
> > > Thanks,
> > >
> > > Freddy
> > >
> > >
> > >
> > > "Don Guillett" wrote:
> > >
> > > > How about putting the macro in a regular module and calling it from the
> > > > worksheet_change event OR the other macro?
> > > >
> > > > --
> > > > Don Guillett
> > > > SalesAid Software
> > > > (E-Mail Removed)
> > > > "Freddy" <(E-Mail Removed)> wrote in message
> > > > news:2FC95372-568A-4B86-AF4A-(E-Mail Removed)...
> > > > > Hi,
> > > > >
> > > > > I have two worksheets, the first stores results from various tests. One
> > > > > test
> > > > > is performed on every tenth specimen. When the data from this every tenth
> > > > > test changes, a Worksheet_Change macro runs and pulls the data from the
> > > > > last
> > > > > 30 specimens into another worksheet where I analyze the data using a chart
> > > > > and various SPC tests.
> > > > >
> > > > > I have another Worksheet_Change macro in the SPC worksheet that will run
> > > > > when the 30 test results are updated (manually). If the results fail any
> > > > > of
> > > > > the SPC tests, an email is automatically sent.
> > > > >
> > > > >
> > > > >
> > > > > My question - Is there a way to tie run the Worksheet_Change macro from
> > > > > the
> > > > > SPC Worksheet at the bottom of the original Worksheet_Change? I have seen
> > > > > the
> > > > > post "How to call a macro from another worksheet" on 7/12/06, but if I
> > > > > move
> > > > > my Worksheet_Change macro from the SPC Worksheet to a General Module, it
> > > > > no
> > > > > longer works when I manually update the data in teh SPC Worksheet.
> > > > >
> > > > > Any ideas? Is it even possible to call one Worksheet_Change macro from
> > > > > another Worksheet_Change macro?
> > > > >
> > > > > Thanks,
> > > > >
> > > > > Freddy
> > > > >
> > > > >
> > > > >
> > > >
> > > >
> > > >

 
Reply With Quote
 
=?Utf-8?B?SkxHV2hpeg==?=
Guest
Posts: n/a
 
      29th Oct 2006
Worksheet_Change runs at the time a change occurs to the worksheet. If you
make three changes, it runs three times, each time as a change is made.

"Freddy" wrote:

> Can two macros run at the same time? I think it could be possible that the
> first hasn't completely finished running when the second is starting.
>
> Thanks,
>
> Freddy
>
>
> "Freddy" wrote:
>
> > Yes, I thought that it would automatically run when I started writing this
> > macro series.
> >
> > The first Worksheet_Change macro on the first workbook works fine. The
> > second worksheet (where the first worksheet_change macro stores the last 30
> > data points) also has a Worksheet_Change macro that looks at certain test I
> > have set up. If the data passes the test, I have and IF formula issue a value
> > of 0, if it fails 1.
> >
> > The second Worksheet_Change macro (that is attached to the second worksheet)
> > looks at the values from the If statement - if they are greater than 0. The
> > macro should send an email.
> >
> > If I go to the second worksheet, and MANUALLY change the last datapoint so
> > the tests will fail, the email gets sent. It doesn't when I let the
> > Worksheet_Change macro from the original worksheet pull the data over to the
> > second worksheet.
> >
> > "JLGWhiz" wrote:
> >
> > > Freddy, you have me confused. If you have a Worksheet_Change() macro, would
> > > it not automatically run if you make a worksheet change? Why do you need to
> > > call it from another sheet if it is tied to the sheet where the change
> > > occurs? Is sounds to me like you are looking for a different kind of macro
> > > that will be initiated based on a condition which can be controlled with an
> > > "If ... Then ... Else" statement. What do you think, Don?
> > >
> > > "Freddy" wrote:
> > >
> > > > Hi Don,
> > > >
> > > > I've already tried putting the second Worksheet_Change event and the send
> > > > email macro that goes with it module 1. I call to it at the bottom of my
> > > > first Worksheet_Change with:
> > > >
> > > > Application.Run "75851_Plasticity_Last_30!Worksheet_Change"
> > > >
> > > > When I run the first Worksheet_Change, I receive the error: The macro cannot
> > > > be found.
> > > >
> > > > Any thoughts?
> > > >
> > > > Thanks,
> > > >
> > > > Freddy
> > > >
> > > >
> > > >
> > > > "Don Guillett" wrote:
> > > >
> > > > > How about putting the macro in a regular module and calling it from the
> > > > > worksheet_change event OR the other macro?
> > > > >
> > > > > --
> > > > > Don Guillett
> > > > > SalesAid Software
> > > > > (E-Mail Removed)
> > > > > "Freddy" <(E-Mail Removed)> wrote in message
> > > > > news:2FC95372-568A-4B86-AF4A-(E-Mail Removed)...
> > > > > > Hi,
> > > > > >
> > > > > > I have two worksheets, the first stores results from various tests. One
> > > > > > test
> > > > > > is performed on every tenth specimen. When the data from this every tenth
> > > > > > test changes, a Worksheet_Change macro runs and pulls the data from the
> > > > > > last
> > > > > > 30 specimens into another worksheet where I analyze the data using a chart
> > > > > > and various SPC tests.
> > > > > >
> > > > > > I have another Worksheet_Change macro in the SPC worksheet that will run
> > > > > > when the 30 test results are updated (manually). If the results fail any
> > > > > > of
> > > > > > the SPC tests, an email is automatically sent.
> > > > > >
> > > > > >
> > > > > >
> > > > > > My question - Is there a way to tie run the Worksheet_Change macro from
> > > > > > the
> > > > > > SPC Worksheet at the bottom of the original Worksheet_Change? I have seen
> > > > > > the
> > > > > > post "How to call a macro from another worksheet" on 7/12/06, but if I
> > > > > > move
> > > > > > my Worksheet_Change macro from the SPC Worksheet to a General Module, it
> > > > > > no
> > > > > > longer works when I manually update the data in teh SPC Worksheet.
> > > > > >
> > > > > > Any ideas? Is it even possible to call one Worksheet_Change macro from
> > > > > > another Worksheet_Change macro?
> > > > > >
> > > > > > Thanks,
> > > > > >
> > > > > > Freddy
> > > > > >
> > > > > >
> > > > > >
> > > > >
> > > > >
> > > > >

 
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
Worksheet_Change - initiate macro on another worksheet oms Microsoft Excel Programming 4 11th Mar 2008 03:26 PM
Call macro in worksheet from userform? Ed from AZ Microsoft Excel Programming 2 12th Sep 2007 08:15 PM
Combine 2 codes from WorkSheet_Change & WorkSheet _SelectionChange to ONLY WorkSheet_Change Corey Microsoft Excel Programming 2 17th Dec 2006 09:59 PM
call a macro in another worksheet? =?Utf-8?B?R2VvcmdlIENvbmFyZA==?= Microsoft Excel Programming 2 16th May 2005 08:38 PM
how to call a macro from a worksheet event? lopsided Microsoft Excel Programming 5 16th Dec 2003 10:28 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 05:12 PM.