childrenfirst
Technical User
Hi,
I have a macro which highlights selected cell and also displays a pop up message when a cell is selected. My I would like to modify it so that it only highlights the cell and shows popup message when a cell in column, AD, is selected. How should I revise the macro I have?
Here is what I have so far:
Private Sub Workbook_SheetSelectionChange(ByVal Sh As Object, ByVal Target As Range)
Static OldRange As Range
On Error Resume Next
Target.Interior.ColorIndex = 6 ' yellow - change as needed
MsgBox "Display popup!",vbOkOnly
OldRange.Interior.ColorIndex = xlColorIndexNone
Set OldRange = Target
End Sub
I have a macro which highlights selected cell and also displays a pop up message when a cell is selected. My I would like to modify it so that it only highlights the cell and shows popup message when a cell in column, AD, is selected. How should I revise the macro I have?
Here is what I have so far:
Private Sub Workbook_SheetSelectionChange(ByVal Sh As Object, ByVal Target As Range)
Static OldRange As Range
On Error Resume Next
Target.Interior.ColorIndex = 6 ' yellow - change as needed
MsgBox "Display popup!",vbOkOnly
OldRange.Interior.ColorIndex = xlColorIndexNone
Set OldRange = Target
End Sub