Private Sub Worksheet_SelectionChange(ByVal Target As Range)
Dim Açýklama_Ekleme As Comment
Dim strText As String
If Target.Column > 37 Then Exit Sub
If Len(Cells(Target.Row, 1)) <> 6 Then Exit Sub
If Cells(Target.Row, Target.Column).Comment Is Nothing Then
strText = Application.InputBox("Eklenecek olan mesajý aþaðýya yazýnýz.", _
"Açýklama_Ekleme", "Açýklama Ekler", , , , 2)
Else
strText = Application.InputBox("Eklenecek olan mesajý aþaðýya yazýnýz.", _
"Açýklama_Ekleme", Target.Comment.Text, , , , 2)
End If
If strText = "" Then Exit Sub
On Error Resume Next
If strText = False Then Exit Sub
On Error GoTo 0
If Application.ExecuteExcel4Macro("Get.Cell(46)") = True Then
Target.Comment.Delete
End If
Target.AddComment
Set Açýklama_Ekleme = Target.Comment
With Açýklama_Ekleme
.Text Text:=strText
With .Shape.TextFrame.Characters.Font
.Name = "Arial"
.Size = 8
.Bold = False
End With
End With
End Sub
A sütunundaki veri uzunluk 6 ise işlem yapar.