ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Run/call a macro when value in cell A5 changes (https://www.excelbanter.com/excel-programming/418303-run-call-macro-when-value-cell-a5-changes.html)

Arno

Run/call a macro when value in cell A5 changes
 
Hello,

I need a macro to run/call another macro when values in cell A5 changes.

Can you please advise if the syntax below is correct.

So far I cannot get it to work ....

Thank you !! Arno


Sub Last()
Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Address = "$A$5" Then
Graph2
End If
End Sub

Don Guillett

Run/call a macro when value in cell A5 changes
 
Should work OK if you put in the sheet module where cell a5 resides. Right
click sheet tabview codecopy/paste there without the sub last() line

Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Address = "$A$5" Then graph2
End Sub

Sub graph2()
MsgBox "Works Just fine"
End Sub

--
Don Guillett
Microsoft MVP Excel
SalesAid Software

"Arno" wrote in message
...
Hello,

I need a macro to run/call another macro when values in cell A5 changes.

Can you please advise if the syntax below is correct.

So far I cannot get it to work ....

Thank you !! Arno


Sub Last()
Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Address = "$A$5" Then
Graph2
End If
End Sub



Mike H

Run/call a macro when value in cell A5 changes
 
Hi,

Providing you have a sub called Graph2 then this should work

Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Address = "$A$5" Then
Graph2
End If
End Sub

Mike

"Arno" wrote:

Hello,

I need a macro to run/call another macro when values in cell A5 changes.

Can you please advise if the syntax below is correct.

So far I cannot get it to work ....

Thank you !! Arno


Sub Last()
Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Address = "$A$5" Then
Graph2
End If
End Sub


Arno

Run/call a macro when value in cell A5 changes
 
I tried to copy and past as suggested but I get this msg: Ambiguous name
detected: Worksheet_change.

Do you have an idea why ?

Thank you so far !

"Arno" wrote:

Hello,

I need a macro to run/call another macro when values in cell A5 changes.

Can you please advise if the syntax below is correct.

So far I cannot get it to work ....

Thank you !! Arno


Sub Last()
Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Address = "$A$5" Then
Graph2
End If
End Sub


Dave Peterson

Run/call a macro when value in cell A5 changes
 
You only get one worksheet_Change event for each sheet.

And you have at least two of them.

You'll have to combine them into a single routine.

Arno wrote:

I tried to copy and past as suggested but I get this msg: Ambiguous name
detected: Worksheet_change.

Do you have an idea why ?

Thank you so far !

"Arno" wrote:

Hello,

I need a macro to run/call another macro when values in cell A5 changes.

Can you please advise if the syntax below is correct.

So far I cannot get it to work ....

Thank you !! Arno


Sub Last()
Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Address = "$A$5" Then
Graph2
End If
End Sub


--

Dave Peterson

Arno

Run/call a macro when value in cell A5 changes
 
Hi Mike,
More than one object in the same scope may have elements with the same name.
The identifier conflicts with another identifier or requires qualification.

The macro you sent me is in conflict with another which is similar. Pls see
below
Can you help to adjust:


Private Sub Worksheet_Change(ByVal Target As Range)
Const WS_RANGE As String = "$A$3"

On Error GoTo ws_exit
Application.EnableEvents = False

If Not Intersect(Target, Me.Range(WS_RANGE)) Is Nothing Then
With Target
Call Master
End With
End If


"Arno" wrote:

Hello,

I need a macro to run/call another macro when values in cell A5 changes.

Can you please advise if the syntax below is correct.

So far I cannot get it to work ....

Thank you !! Arno


Sub Last()
Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Address = "$A$5" Then
Graph2
End If
End Sub


Arno

Run/call a macro when value in cell A5 changes
 
Could you please advise me how to combine them into a single routine.

Thank you

"Arno" wrote:

Hello,

I need a macro to run/call another macro when values in cell A5 changes.

Can you please advise if the syntax below is correct.

So far I cannot get it to work ....

Thank you !! Arno


Sub Last()
Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Address = "$A$5" Then
Graph2
End If
End Sub


Dave Peterson

Run/call a macro when value in cell A5 changes
 
I think you'll have to share the existing code.

Arno wrote:

Could you please advise me how to combine them into a single routine.

Thank you

"Arno" wrote:

Hello,

I need a macro to run/call another macro when values in cell A5 changes.

Can you please advise if the syntax below is correct.

So far I cannot get it to work ....

Thank you !! Arno


Sub Last()
Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Address = "$A$5" Then
Graph2
End If
End Sub


--

Dave Peterson

Mike H

Run/call a macro when value in cell A5 changes
 
Hi,

It would have helped if you posted all your code. Not tested but this should
combine them.

Private Sub Worksheet_Change(ByVal Target As Range)
Const WS_RANGE As String = "$A$3"

On Error GoTo ws_exit
Application.EnableEvents = False

If Not Intersect(Target, Me.Range(WS_RANGE)) Is Nothing Then
With Target
Call Master
End With
End If

ws_exit:
Application.EnableEvents = True
If Target.Address = "$A$5" Then
Graph2
End If
End Sub

Mike

"Arno" wrote:

Could you please advise me how to combine them into a single routine.

Thank you

"Arno" wrote:

Hello,

I need a macro to run/call another macro when values in cell A5 changes.

Can you please advise if the syntax below is correct.

So far I cannot get it to work ....

Thank you !! Arno


Sub Last()
Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Address = "$A$5" Then
Graph2
End If
End Sub


Arno

Run/call a macro when value in cell A5 changes
 
Mike,

I have no words to thank you ! I worked staight away !!!

This was the last step of a difficult xls file with about 20 macros. Now
everything work ! Thank you so much again!!!!!!

Thank to you Dave as well !!!!!!

"Arno" wrote:

Hello,

I need a macro to run/call another macro when values in cell A5 changes.

Can you please advise if the syntax below is correct.

So far I cannot get it to work ....

Thank you !! Arno


Sub Last()
Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Address = "$A$5" Then
Graph2
End If
End Sub


Mike H

Run/call a macro when value in cell A5 changes
 
I'm glad I could help and even more so from the pleasure it seems to give you
:)

"Arno" wrote:

Mike,

I have no words to thank you ! I worked staight away !!!

This was the last step of a difficult xls file with about 20 macros. Now
everything work ! Thank you so much again!!!!!!

Thank to you Dave as well !!!!!!

"Arno" wrote:

Hello,

I need a macro to run/call another macro when values in cell A5 changes.

Can you please advise if the syntax below is correct.

So far I cannot get it to work ....

Thank you !! Arno


Sub Last()
Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Address = "$A$5" Then
Graph2
End If
End Sub



All times are GMT +1. The time now is 11:38 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com