Excel マクロで画像を移動


Excel VBAで画像を移動させる

Sub 右移動()

    Sheet1.Shapes("Picture 2").Left = Sheet1.Shapes("Picture 2").Left + 10
    Sheet1.Shapes("Picture 2").Rotation = 90

End Sub

Sub 左移動()

    Sheet1.Shapes("Picture 2").Left = Sheet1.Shapes("Picture 2").Left - 10
    Sheet1.Shapes("Picture 2").Rotation = -90

End Sub
Sub 上移動()

    Sheet1.Shapes("Picture 2").Top = Sheet1.Shapes("Picture 2").Top - 10
    Sheet1.Shapes("Picture 2").Rotation = 0

End Sub
Sub 下移動()

    Sheet1.Shapes("Picture 2").Top = Sheet1.Shapes("Picture 2").Top + 10
    Sheet1.Shapes("Picture 2").Rotation = 180

End Sub