12 Şubat 2015 Perşembe

Excel VBA Hücreye Açıklama Ekleme

Sub AciklamaEkle()
   Dim S1 As Worksheet
   Set S1 = Worksheets("Sayfa1")
   Call Aciklama_Ekle (S1.Cells(1, 1), "Açıklama Eklendi")
End Sub

Function Aciklama_Ekle(hucre As Range, note As String)
   Dim cmt As Comment
   Set cmt = hucre.Comment
   If cmt Is Nothing Then
      Set cmt = hucre.AddComment
      cmt.Text Text:=note
   Else
      note = note & Chr(10) & cmt.Text
      cmt.Text Text:=note
      If cmt.Shape.Height < 150 Then cmt.Shape.Height = cmt.Shape.Height + 20
   End If
   cmt.Visible = False
End Function

Hiç yorum yok:

Yorum Gönder