指定列にある画像を揃えるマクロです。
列の指定方法やらシートの選択方法をselectionとかにしておいて
右クリックに関数を登録しておけばもっと使い勝手がよくなるのかな。
Sub ImageCenter()
Dim pict
On Error Resume Next
For Each pict In Sheets("○○○").Shapes
Debug.Print pict.TopLeftCell.Left
'イメージのみを判断する 10列目のせるのみを処理する。
If pict.Type = 13 And pict.TopLeftCell.Column = 10 Then
'横を合わせる
pict.Left = (pict.TopLeftCell.Left + pict.TopLeftCell.Width / 2) - pict.Width / 2
'縦を合わせる
pict.Top = (pict.TopLeftCell.Top + pict.TopLeftCell.Height / 2) - pict.Height / 2
End If
Next pict
End Sub
工作と小物のがらくた部屋
それ、僕が図解します。