Two questions -
I am trying to write a code to run few worksheet changes depending on changes in value of ONLY one cell $A$4. I don't want any other changes in the worksheet to do anything.
So I ran below sample code on a blank worksheet.
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
If Target.Address = "$A$4" Then
Range("$B$4").Value = "changed"
End If
Range("$C$4").Value = "not changed"
End Sub
With this, even when I just click on one of the cells the event is triggered. (i.e. I am not writing anything in the cell, just clicking on it.
My question -
1) Is it then true that the worksheet.change code is running in the background all the time catching any changes but doing nothing? Is that not overhead slowing excel sheet down?
2) Why is it triggering when only clicking on the cell, is there a way to trigger only when something is manually entered in the cell?
I am trying to write a code to run few worksheet changes depending on changes in value of ONLY one cell $A$4. I don't want any other changes in the worksheet to do anything.
So I ran below sample code on a blank worksheet.
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
If Target.Address = "$A$4" Then
Range("$B$4").Value = "changed"
End If
Range("$C$4").Value = "not changed"
End Sub
With this, even when I just click on one of the cells the event is triggered. (i.e. I am not writing anything in the cell, just clicking on it.
My question -
1) Is it then true that the worksheet.change code is running in the background all the time catching any changes but doing nothing? Is that not overhead slowing excel sheet down?
2) Why is it triggering when only clicking on the cell, is there a way to trigger only when something is manually entered in the cell?