Dim m
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
Call CentreCommnetaire Target
End Sub
Private Sub CentreCommnetaire(ByVal Target As Range)
If m <> "" Then Range(m).Comment.Visible = False
If Not Target.Comment Is Nothing Then
Application.ScreenUpdating = False
Target.Comment.Visible = True
Call CentreImage Target.Comment.Shape
m = Target.Address
Application.ScreenUpdating = True
Else
m = ""
End If
End Sub
Sub CentreImage(Im as Shape)
Dim HautImage As Long, GaucheImage As Long
Application.ScreenUpdating = False
With ActiveWindow.ActivePane.VisibleRange
HautImage = .Top + (.Height / 2)
GaucheImage = .Left + (.Width / 2)
End With
With ActiveSheet.Shapes(Im)
.Top = HautImage - (.Height / 2)
.Left = GaucheImage - (.Width / 2)
End With
Application.ScreenUpdating = True
End Sub