I am trying to teach myself VBA and am having trouble below defining the range. Everything is working except for the fact that any change on the sheet is adding the comment. I only want the code to run if cell a1 = 3 and I don't know where I am going wrong.
Any help would be much appreciated!
Sub worksheet_change(ByVal Target As Range)
If Target.Range("a1") = 3 Then
If MsgBox("How are you", vbOKCancel) = vbOK Then
Range("c4").Select
ActiveCell.AddComment "Outbound Only"
End If
End If
End Sub
Any help would be much appreciated!
Sub worksheet_change(ByVal Target As Range)
If Target.Range("a1") = 3 Then
If MsgBox("How are you", vbOKCancel) = vbOK Then
Range("c4").Select
ActiveCell.AddComment "Outbound Only"
End If
End If
End Sub