Private Sub Worksheet_Change(ByVal Target As Range) Dim cell As Object On Error GoTo xErr: For Each cell In Target If Not Intersect(cell, Range("B5")) Is Nothing Then Application.EnableEvents = False If cell.Value <> "" Then cell.Interior.ColorIndex = xlNone 'delete comment cell.Comment.Delete Else cell.Interior.ColorIndex = 36 'zlta 'pridaj comment If Not (cell.Comment Is Nothing) Then cell.Comment.Delete cell.AddComment cell.Comment.Visible = False cell.Comment.Text Text:=Range("E2").Text End If Application.EnableEvents = True End If Next cell Exit Sub xErr: Application.EnableEvents = True End Sub
Užitočné (1) | marjankaj |
Užitočné (1) | marjankaj |