Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
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 |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
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 |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
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 |
#4
Posted to microsoft.public.excel.programming
|
|||
|
|||
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 |
#5
Posted to microsoft.public.excel.programming
|
|||
|
|||
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 |
#6
Posted to microsoft.public.excel.programming
|
|||
|
|||
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 |
#7
Posted to microsoft.public.excel.programming
|
|||
|
|||
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 |
#8
Posted to microsoft.public.excel.programming
|
|||
|
|||
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 |
#9
Posted to microsoft.public.excel.programming
|
|||
|
|||
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 |
#10
Posted to microsoft.public.excel.programming
|
|||
|
|||
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 |
#11
Posted to microsoft.public.excel.programming
|
|||
|
|||
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 |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
call macro if cell is selected | Excel Programming | |||
call macro X by cell value | Excel Programming | |||
How do i call a macro from a cell | Excel Programming | |||
Call Macro when Cell within Range Changes | Excel Programming |