Create a Simple PowerPoint Macro to Resize Photos

Save time by resizing many images quickly

What to Know

  • Go to View > Macros, enter a name for the macro and select Create, then enter the code for the macro.
  • Save the macro as a PowerPoint Macro-Enabled Presentation.
  • To apply the macro, go to View > Macros, choose the macro you made, and then select Run.

This article explains how to create a PowerPoint macro to resize photos so that all images are the same size and in the same position on the slide. Instructions apply to PowerPoint 2019, 2016, 2013, and PowerPoint for Microsoft 365.

Add the Images to PowerPoint Slides

If you have a large number of images to include in PowerPoint, speed up the process of resizing them without repeating the tedious task for each picture by creating a macro to do the job for you.

Before you begin, insert all the images you want to use in the PowerPoint presentation.

  1. Open a PowerPoint presentation and select the first slide that will hold an image.

  2. Go to Insert. 

  3. Select Pictures > Picture From File.

  4. Choose an image on your computer and select Insert.

  5. Repeat this process to add photos to the other slides in your presentation.

    A screenshot showing a presentation with photos on several slides
  6. Do not be concerned that the photos are too large or too small for the slides at this point. The macro will take care of resizing images so they are the same size.

Record a Macro to Resize the Images

After all the images have been inserted in your PowerPoint presentation, create a macro to reduce all the images to the same size and position on the slide. Before you create the macro to automate the task, you may want to practice the steps on a single image to make sure you get the exact results you want.

  1. Go to View and select Macros.

    A screenshot showing how to create a new macro in a PowerPoint presentation
  2. In the Macro dialog box, enter a Macro name.

    The name can contain letters and numbers, but must begin with a letter and cannot contain any spaces. Use the underscore to indicate a space in the macro name.

    A screenshot showing how to name a macro in PowerPoint
  3. The Macro in list displays the name of the presentation you're working on.

    A macro can be applied to several presentations. Open the other presentations and select All open presentations.

  4. Select Create to open Microsoft Visual Basic for Applications.

    A screenshot of Visual Basic for Applications in PowerPoint
  5. Enter the following information but replace the numbers after the equal sign with your own desired image size and placement. Enter numbers in points. For example:

    sub ResizePhotos ()
    With ActiveWindow.Selection.ShapeRange
    .Height = 418.3
    .Width = 619.9
    .Left = 45
    .Top = 45
    End With
    End Sub
    A screenshot showing example VBA code to resize an image in PowerPoint
  6. Select Save to open Save As dialog box.

  7. In the Save as type list, choose PowerPoint Macro-Enabled Presentation.

    A screenshot showing how to enable macros in a PowerPoint presentation
  8. Select Save.

  9. Close Visual Basic for Applications.

Apply the Macro to Resize Images in Your Presentation

  1. Select an image you want to resize.

  2. Go to View and select Macros.

  3. Choose the macro you just made and select Run.

    A screenshot showing how to run a macro in PowerPoint
  4. Your image is resized and moved. Continue to apply the macro to the other images in your presentation.

Was this page helpful?