AW: Kommentarfeldgröße anpassen
11.02.2021 11:40:41
MCO
Hallo Constantin!
Hiermit kommst du sicher weiter:
Sub Kommentargrößen_anpassen()
On Error GoTo ende:
Dim rng As Range
Set rng = ActiveWindow.VisibleRange
If Selection.Count > 1 Then Set rng = Selection
Set rng = rng.SpecialCells(xlCellTypeVisible)
On Error Resume Next
For Each shp In rng.SpecialCells(xlCellTypeComments)
With shp.Comment.Shape
.Top = shp.Offset(-1, 1).Top + 10
.Left = shp.Offset(-1, 1).Left + 15
.TextFrame.AutoSize = True
End With
shp.Comment.Text Trim(shp.Comment.Text)
shp.Comment.Visible = 0
Next shp
Exit Sub
ende:
If Err.Number 0 Then MsgBox Err.Description, VB, "Fehler", Err.HelpFile, Err.HelpContext
End Sub
Gruß, MCO