ManUBlueJay
Active Member
- Joined
- Aug 30, 2012
- Messages
- 302
- Office Version
- 2016
- Platform
- Windows
I would like to run a macro when the selection changes in a given range, and the active cell is a certain phrase.
I put this code in the worksheet part of the code.
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
If Not Intersect(Target, Range("My Range")) Is Nothing And ActiveCell.Value <> "Phrase" Then
End Sub
However I only want the code to run when the ActiveCell is in My Range.
How I have it,the code runs every time and checks for the ActiveCell's content
I put this code in the worksheet part of the code.
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
If Not Intersect(Target, Range("My Range")) Is Nothing And ActiveCell.Value <> "Phrase" Then
End Sub
However I only want the code to run when the ActiveCell is in My Range.
How I have it,the code runs every time and checks for the ActiveCell's content