How To Rotate A Picture In Excel Manually Or Programmatically

This article will tell you how to rotate a picture in Excel manually or programmatically with examples.

1. How To Rotate A Picture In Excel Manually.

  1. Insert a picture into your Excel worksheet ( you can read the article How To Insert And Stick Picture In Excel Cell To Move, Resize, And Filter The Picture With The Cell ).
  2. Click the picture to select it, then you will find there is a rotation icon on the top middle of the image.
  3. Move your mouse pointer to the rotation icon, and click the left mouse key.
  4. Then you can rotate the picture by rotating your mouse pointer to the left or the right.
  5. You can also change the picture size by dragging the circle dot on each center point or corner point of the picture.
  6. Besides the above method, you can right-click the picture, and then click the Format Picture… menu item to open the Format Picture pane on the right side.
  7. Click the third Size & Properties tab on the Format Picture pane.
  8. Expand the Size arrow, then you can adjust the picture size and rotation value in the related text field.

2. How To Rotate A Picture In Excel Programmatically.

  1. If you want to rotate a picture in Excel programmatically, you need to use VBA.
  2. Input an integer number in Excel cell A1, and the picture will rotate the degree based on this integer number.
  3. Click to select the image and click the Developer tab —> Visual Basic icon to open the Visual Basic editor window.
  4. In the pop-up Microsoft Visual Basic for Applications window, click the Insert —> Module menu item to insert a new module.
  5. Copy the below VBA source code into the new module editor window.
    Sub RotatePicture()
    Selection.ShapeRange.IncrementRotation ActiveSheet.Range("A1").Value
    End Sub
  6. Click the green Run button on the top toolbar to run the above code.
  7. Then you will see the picture is rotated on the Excel worksheet.
  8. You can change the value in Excel cell A1, and run the VBA source code again to see different effects.
  9. You should select the picture first before running the VBA source code, otherwise, you may encounter the Run-time error ‘438’ Object doesn’t support this property or method.

Leave a Comment

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.