L. Howard Kittle said:
Hi Gary,
I got some advice from Chip P, an MVP, on my code and it works for me on my
sheet. If the "Target "Range("F1")" moves about on your sheet, we have a
problem.
If you would like, send me a sample worksheet and advice on what you want to
happen an I will be glad to at least take a look at it.
Do the obvious here... lhkittle at dot comcast dot net
Regards,
Howard
lhkittle at dot comcast dot net
Thanks Chip, I changed...
If Target <> Range("F1") Then Exit sub
To:
If Target <> Range("F1") Then
Application.EnableEvents = True
Exit Sub
End If
WOW, seems to have solved the problem.
Have to admit, I do not understand why the "select rows > delete comments"
event would bust the code. Also I delete cell contents... but whatever???
Thanks a ton Chip, always a pleasure!
Regards,
Howard
New code...
Option Explicit
Private Sub Worksheet_Change(ByVal Target As Range)
On Error Resume Next
Application.EnableEvents = False
If Target <> Range("F1") Then
Application.EnableEvents = True
Exit Sub
End If
Range("A100").End(xlUp).Offset(1, 0).Select
With Selection
.AddComment
.Comment.Text Text:=Range("E1").Value & ":" _
& Chr(10) & Range("F1").Value
.Comment.Visible = True
.Value = Range("F1").Value
End With
Range("F1").ClearContents
Range("F1").Select
Application.EnableEvents = True
End Sub
Hi Howard,