J
Jock
Hi,
The following code should:
1) add a comment with text & date when a date is entered in a cell in 'I'
2) append the above comment with new text and date when a date is entered in
'J'
The first part works fine, but the second doesn't and I can't figure out why!
Private Sub Worksheet_Change(ByVal Target As Range)
'adds a comment box to cells in column K (if an "Certificate of Service"
date is entered
On Error Resume Next
If Not Intersect(Target, Me.Range("I6:I30")) Is Nothing Then
With Target
If .Value <> "" Then
Application.EnableEvents = False
Target.Offset(0, 2).AddComment.Text Text:="AoS due date: " &
Target.Value + 14
On Error GoTo 0
Application.EnableEvents = True
End If
End With
End If
'appends the comment box in cells in column K if a "Particulars of Claim"
date is entered
On Error Resume Next
If Not Intersect(Target, Me.Range("J5:J30")) Is Nothing Then
With Target
If .Value <> "" Then
Application.EnableEvents = False
Target.Offset(0, 1).EditComment.Text Text:="Due date: " &
Target.Value + 14
On Error GoTo 0
Application.EnableEvents = True
End If
End With
End If
End Sub
Any ideas?
Thanks
The following code should:
1) add a comment with text & date when a date is entered in a cell in 'I'
2) append the above comment with new text and date when a date is entered in
'J'
The first part works fine, but the second doesn't and I can't figure out why!
Private Sub Worksheet_Change(ByVal Target As Range)
'adds a comment box to cells in column K (if an "Certificate of Service"
date is entered
On Error Resume Next
If Not Intersect(Target, Me.Range("I6:I30")) Is Nothing Then
With Target
If .Value <> "" Then
Application.EnableEvents = False
Target.Offset(0, 2).AddComment.Text Text:="AoS due date: " &
Target.Value + 14
On Error GoTo 0
Application.EnableEvents = True
End If
End With
End If
'appends the comment box in cells in column K if a "Particulars of Claim"
date is entered
On Error Resume Next
If Not Intersect(Target, Me.Range("J5:J30")) Is Nothing Then
With Target
If .Value <> "" Then
Application.EnableEvents = False
Target.Offset(0, 1).EditComment.Text Text:="Due date: " &
Target.Value + 14
On Error GoTo 0
Application.EnableEvents = True
End If
End With
End If
End Sub
Any ideas?
Thanks