
Private Sub Worksheet_Change(ByVal Target As Range)
If Not Intersect(Target, Range("D1")) Is Nothing Then
For Line = 1 To 6
If Target.Value = Line Then
Range("D1").Comment.Text Text:=Cells(Line, "B").Value
End If
Next
End If
End Sub |
Option Explicit
Private Sub Worksheet_Change(ByVal Target As Range)
Dim strCom As String
Dim Line As Long
If Target.Column = 4 Then
For Line = 1 To 6
If Target.Value = Line Then
strCom = Sheets("Foglio2").Cells(Line, Target.Column + 1).Value
With Target
.AddComment
.Comment.Text Text:=strCom
End With
End If
Next
End If
End Sub
|
