The code below only runs if the Target.Address = "$A$1" . If i change the
Target.Address to ="$B$1" and make a change to cell B1 the macro won't run.
Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Address = "$A$1" Then
Application.Run "Test_Output_file!Macro1"
End If
End Sub
Thanks in advance for any help
ram - 24 May 2006 14:50 GMT
I wasn't using uppercase B in the Target. Address. Now it's working fine.
> The code below only runs if the Target.Address = "$A$1" . If i change the
> Target.Address to ="$B$1" and make a change to cell B1 the macro won't run.
[quoted text clipped - 6 lines]
>
> Thanks in advance for any help
Ivan Raiminius - 24 May 2006 14:53 GMT
Hi,
you are comparing two strings, so you have to be sure that they will be
the same (if target.address is "$B$1" and in your condition you have
Target.Address = "$b$1", then these two strings don't match).
There are many ways how to do it:
If Target.Address = range("b1").address Then
or
if not intersect(target,range("b1") is nothing then
for example.
Regards,
Ivan