wonderboutin
Board Regular
- Joined
- Jan 7, 2005
- Messages
- 77
I want active a macro is the Range("A1") have a new value.
"A1" = (=sheet2!B1) A1 is in sheet1
if I write a new value in sheet2!B1, sheet1!A1 have a new value and i want to active macro
I try this macro
Private Sub Worksheet_Change(ByVal Target As Range)
If MY_OLD_VALUE <> Range("A1") <> Value Then
'your code here
End If
End Sub
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
MY_OLD_VALUE = Range("a1").Value
End Sub
but is good if I change the value of A1 but if A1 is a copy of a other cell, then macro is not activated
tanks
"A1" = (=sheet2!B1) A1 is in sheet1
if I write a new value in sheet2!B1, sheet1!A1 have a new value and i want to active macro
I try this macro
Private Sub Worksheet_Change(ByVal Target As Range)
If MY_OLD_VALUE <> Range("A1") <> Value Then
'your code here
End If
End Sub
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
MY_OLD_VALUE = Range("a1").Value
End Sub
but is good if I change the value of A1 but if A1 is a copy of a other cell, then macro is not activated
tanks