Bonjour,
Je voudrais juste que toute mes images de ma colonne "B" soit centrer.
j'ai essayé de modifier la formule un peu plus haut mais sans succès. Pouvez -vous m'aider?
Sub Centre()
Dim J As Long
Dim Gauche As Double, Haut As Double, Largeur As Double, Hauteur As Double
Dim Sh As Shape
On Error GoTo labas
Application.ScreenUpdating = False
For J = 5 To Range("H" & Rows.Count).End(xlUp).Row
Set Sh = ActiveSheet.Shapes(Range("H" & J))
With Range("B" & J)
Sh.Left = .Left + (.Width / 2) - (Sh.Width / 2)
Sh.Top = .Top + (.Height / 2) - (Sh.Height / 2)
End With
ici:
Next J
Application.ScreenUpdating = True
End
labas:
Resume ici
End Sub
h2so4 a écrit :
bonjour,
une proposition de solution
Sub Centre()
Dim J As Long
Dim Gauche As Double, Haut As Double, Largeur As Double, Hauteur As Double
Dim Sh As Shape
On Error GoTo labas
Application.ScreenUpdating = False
For J = 5 To Range("H" & Rows.Count).End(xlUp).Row
Set Sh = ActiveSheet.Shapes(Range("H" & J))
With Range("G" & J)
Sh.Left = .Left + (.Width / 2) - (Sh.Width / 2)
Sh.Top = .Top + (.Height / 2) - (Sh.Height / 2)
End With
ici:
Next J
Application.ScreenUpdating = True
End
labas:
Resume ici
End Sub