you declared
in Worksheet_Change procedure.
So it's visible only inside this procedure
not outside (for instance not in test).
You could have in worksheet code:
Sub Worksheet_Change(ByVal Target As Range)
Set CurRow = ActiveCell
End Sub
and in standard module:
Dim CurRow As Range
Sub test()
if CurRow is nothing then
msgbox "nothing have been changed yet"
else
If ActiveCell.Row = CurRow.Row Then Exit Sub
If Not Intersect(ActiveCell, Range("A2:K50")) Is Nothing Then
With ActiveSheet.Shapes.Range(Array("tree_ccp"))
.Top = ActiveCell(0, 12).Top
End With
End If
end if
End Sub
Bookmarks