Dates and comments
Jock,
Try the worksheet change code below. This is very basic and you would need
to consider what you would do if the cell already had a comment. As a minimum
you should check to see if there is to prevent the code giving an error with
Set cmt = ActiveCell.Comment
If cmt Is Nothing Then
'insert your comment
Private Sub Worksheet_Change(ByVal Target As Range)
If Not IsDate(Target) Or Target.Cells.Count 1 Then Exit Sub
If Not Intersect(Target, Range("D:D")) Is Nothing Then
DateFormat = "dd-mmm-yy"
Newdate = DateAdd("D", 14, Target.Value)
Target.Offset(, 2).AddComment.Text Text:=Format(Newdate, DateFormat)
End If
End Sub
Mike
"Jock" wrote:
When a date is placed in any cell D, I would like either:
1) a comment to automatically be accociated to cell F on the same row with a
date displayed which will be the date from D + 14, OR
2) When the cell in F has focus, the date (D + 14) appears in a pre
determined cell at the top of the page, F2 for instance.
Any ideas?
--
Traa Dy Liooar
Jock
|