Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 60
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 10,124
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,501
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 60
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 35,218
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 60
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 60
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 35,218
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,501
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 60
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,501
Default 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
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
call macro if cell is selected Corey Excel Programming 5 July 17th 06 08:40 AM
call macro X by cell value cyote101[_2_] Excel Programming 4 July 7th 06 09:14 PM
How do i call a macro from a cell KhanhNguyen Excel Programming 1 June 24th 06 11:45 AM
Call Macro when Cell within Range Changes Andibevan[_2_] Excel Programming 4 March 24th 05 04:28 PM


All times are GMT +1. The time now is 07:13 PM.

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"