Private Sub Worksheet_SelectionChange(ByVal Target As Range)
Dim Açýklama_Ekleme As Comment
Dim strText
If Target.Column > 37 Then Exit Sub
If Cells(Target.Row, 2).Value <> "" And Len(Cells(Target.Row, 2).Value + 0) <> 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
B sütununda uzunluk 6 olarak görülüyor oysa başında boşluk var bazılarında.Bundan dolayı 7 olarak gördüğü için çalışmıyordu bu dosyanızda.Trim ekledim fayda etmedi.Alttaki gibi çözdüm.