C
Option Explicit
Sub Commentaire_emplacement_modifier()
Dim com As Comment
For Each com In ActiveSheet.Comments
com.Shape.Left = com.Parent.Left + 20
com.Shape.Top = com.Parent.Top + 20
Next
End Sub
Private Sub Worksheet_BeforeDoubleClick(ByVal R As Range, Cancel As Boolean)
If R.Address = [A1].Address Then R.Comment.Shape.TextFrame.AutoSize = 1
End Sub
... Moi qui cherche à mincir...
Sub Commentaire_modifier()
Dim F As Worksheet, com As Comment
For Each F In Sheets
For Each com In F.Comments
com.Height = h 'à fixer
com.Width = w 'à fixer
Next
Next
End Sub
En attendant mieux... Dans "ThisWorkbook" :... 18 feuillets (et bientôt plus) avec par feuillet en moyenne une trentaine de commentaire. Donc je cherche plutôt une solution qui règle le problème d'un coup pour l'ensemble des commentaires...
Option Explicit
Private Sub Workbook_SheetActivate(ByVal o As Object)
Dim c As Range, com As Comment
For Each o In Worksheets
For Each com In ActiveSheet.Comments
com.Shape.Left = com.Parent.Left + 20
com.Shape.Top = com.Parent.Top + 20
com.Shape.TextFrame.AutoSize = 1
Next
Next
End Sub
Bonjour Nephenie, DoubleZero, SI et à tousRe-bonjour,
En attendant mieux... Dans "ThisWorkbook" :
A bientôtCode:Option Explicit Private Sub Workbook_SheetActivate(ByVal o As Object) Dim c As Range, com As Comment For Each o In Worksheets For Each com In ActiveSheet.Comments com.Shape.Left = com.Parent.Left + 20 com.Shape.Top = com.Parent.Top + 20 com.Shape.TextFrame.AutoSize = 1 Next Next End Sub
P. S. : Bienvenue sur XLD, Nephenie !
Option Explicit
Sub Modifier_commentaires()
Dim F As Worksheet, com As Comment
For Each F In Sheets
For Each com In F.Comments
com.Shape.Left = com.Parent.Left + 75
com.Shape.Top = com.Parent.Top - 12
com.Shape.TextFrame.AutoSize = True
If com.Shape.Width > 140 Then
com.Shape.Width = 140
com.Shape.Height = ((Len(com.Text) / 25) + 1) * 12
End If
Next
Next
End Sub