Hi,
trying to write a script to be performed in Sheet 1 if calculated value in Sheet 3 is changed.
I put this piece of code in sheet 3 just a test to see if I understand how to make an if statement:
Unfortunately, it does not work. Any suggestions on what I´m doing wrong. Tried both with and without the "" for the value 11.
trying to write a script to be performed in Sheet 1 if calculated value in Sheet 3 is changed.
I put this piece of code in sheet 3 just a test to see if I understand how to make an if statement:
Code:
Private Sub Worksheet_Calculate()
Sheet1.Select
If Range("O1").Value = "11" Then
Range("O2").Select
ActiveCell.FormulaR1C1 = "Code works"
End If
End Sub
Unfortunately, it does not work. Any suggestions on what I´m doing wrong. Tried both with and without the "" for the value 11.