P
pthien
The code for my sub is as listed below:-
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
Dim MyRange As Range
Set MyRange = Range(Cells(1, "a"), Cells(2, "b"))
If Target.Address = Range("MyRange").Address Then
Cells(1, "c") = Cells(1, "a") * Cells(1, "b")
Cells(2, "c") = Cells(2, "a") + Cells(2, "b")
End If
End Sub
I am trying to automatically invoke the macros when the values in the cells
for MyRange are changed.
..
I am getting a runtime error '1004'
Can anyone help me, please
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
Dim MyRange As Range
Set MyRange = Range(Cells(1, "a"), Cells(2, "b"))
If Target.Address = Range("MyRange").Address Then
Cells(1, "c") = Cells(1, "a") * Cells(1, "b")
Cells(2, "c") = Cells(2, "a") + Cells(2, "b")
End If
End Sub
I am trying to automatically invoke the macros when the values in the cells
for MyRange are changed.
..
I am getting a runtime error '1004'
Can anyone help me, please