RE: $$Excel-Macros$$ Conditional Comments

2012-03-07 Thread Rajan_Verma
Option Compare Text Private Sub Worksheet_Change(ByVal Target As Range) With Target .ClearComments If .Cells.Count = 1 Then If Target.Value = "Xyz" Then .AddComment ("Good Work") ElseIf .Value = "PQR" Then .AddComment ("Need Improvement")

Re: $$Excel-Macros$$ Conditional Comments

2012-03-07 Thread Maries
Hi, Try it... Private Sub Worksheet_Change(ByVal Target As Range) If Target.Address <> "$A$1" Or Target.Cells.Count > 1 Then Exit Sub Target.ClearComments If Target.Value = "XYZ" Then Target.AddComment ("Good Work") End If If Target.Value = "PQR" Then Target.AddCo