Search code examples
vbaexcelexcel-2007

How to move image in Excel using VBA?


I want to move image from one location in excel to another using VBA.

How can we do that?


Solution

  • If you need to change the position of the image within a given worksheet, you can use something like this:

    ActiveSheet.Shapes.Range(Array("Picture 1")).Select
    Selection.ShapeRange.IncrementLeft 100
    

    You can adjust the direction and amount of motion by changing the parameters of the .Increment... command, to animate an image for example.