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

Excel VBA Hücreye link verme

Sub linkverdene()
   Dim S1 As Worksheet
   Dim S2 As Worksheet
   Set S1 = Worksheets("Sayfa1")
   Set S2 = Worksheets("Sayfa2")
   Call linkver(S1.Cells(1, 1),S2.Cells(1, 1))
   Call linkver(S2.Cells(1, 1),S1.Cells(2, 1))
End Sub
  
Function linkver(nereye As Range, neresi As Range)
     Dim adres As String
     adres = neresi.Address(RowAbsolute:=False)
     Mid(adres, 1, 1) = "!"
     adres = neresi.Worksheet.Name & adres
     nereye.Hyperlinks.Add nereye, Address:="", SubAddress:=adres, ScreenTip:=adres

End Function