How to Insert Pictures Automatically Size to Fit Cells in Excel: 3 Methods

For the purpose of demonstration, I have used the following sample dataset. Here, the dataset contains information about Microsoft Office products. There are 2 columns which, namely the Product and Picture columns.

insert pictures in excel automatically size to fit cells dataset


Method 1 – Utilize Keyboard Shortcuts to Insert Pictures to Fit Cells

Steps:

  1. Select cell C5.
  2. Go to the Insert tab and click on Illustrations.
  3. Select Pictures and click on This Device.
    Utilize Keyboard Shortcuts to Insert Pictures to Fit Cells Automatically
  4. Select the picture you want to insert from the device where the images are stored and click Insert.
  5. Similarly, add other pictures as well.
  6. Adjust the cells according to your desired size.
  7. Hold the Alt key and drag the Microsoft Excel picture until it fits into the cell. Here, the Alt key helps to fit the picture into the entire cell.
    insert pictures in excel automatically size to fit cells
  8. Adjust all the pictures using a similar process.

Read More: How to Insert Picture in Excel Cell Automatically


Method 2 – Using the Format Picture Option in Excel to Make Pictures Fit in Cells

Steps:

  1. Select the Excel product picture and right-click.
  2. Go to Format Picture.
    Use Format Picture Option in Excel to Insert Pictures Automatically Size to Fit Cells
  3. Select Size and set the Height and Width according to your cell size.
    Afterward, the image will fit into the cell.
  4. Similarly, follow the process for the other pictures.

Read More: How to Insert Picture in Excel Using Formula


Method 3 – Inserting Pictures With Excel VBA to Automatically MakeThem Fit in Cells

Steps:

  1. Hold the Alt + F11 keys in Excel, which opens the Microsoft Visual Basic Applications window.
  2. Click the Insert button and select Module from the menu to create a module.Insert Pictures Automatically Size to Fit Cells with Excel VBA
  3. A new window will open. Write the following VBA macro in the Module.
    Public Sub AutoResizeImage()
    On Error GoTo Select_Image
    Dim ZImageWtoHRatio As Single
    Dim QWtoHRatio As Single
    With Selection
    ZImageWtoHRatio = .Width / .Height
    End With
    With Selection.TopLeftCell
    QWtoHRatio = .Width / .RowHeight
    End With
    Select Case ZImageWtoHRatio / QWtoHRatio
    Case Is > 1
    With Selection
    .Width = .TopLeftCell.Width
    .Height = .Width / ZImageWtoHRatio
    End With
    Case Else
    With Selection
    .Height = .TopLeftCell.RowHeight
    .Width = .Height * ZImageWtoHRatio
    End With
    End Select
    With Selection
    .Top = .TopLeftCell.Top
    .Left = .TopLeftCell.Left
    End With
    Exit Sub
    Select_Image:
    MsgBox "Choose an Image and Run the Macro."
    End Sub
    
    insert pictures in excel automatically size to fit cells
  4. Select a picture and press the F5 key to run the code.
  5. Select other pictures one by one and run the code similarly.

Read More: How to Insert Picture in Excel Cell with Text


Download Practice Workbook

You can download the workbook used for the demonstration from the download link below.


Related Articles


<< Go Back to Excel Insert Pictures | Learn Excel

Get FREE Advanced Excel Exercises with Solutions!
Shamima Sultana
Shamima Sultana

Shamima Sultana, BSc, Computer Science and Engineering, East West University, Bangladesh, has been working with the ExcelDemy project for 2 years. She has written over 75+ articles and reviewed 1000+ articles for ExcelDemy. She has also led several teams with Excel VBA and Content Development works. Currently, she is working as the Project Manager and oversees the day-to-day work, leads the services team, allocates resources to the right area, etc. Her work and learning interests vary from Microsoft... Read Full Bio

We will be happy to hear your thoughts

Leave a reply

Advanced Excel Exercises with Solutions PDF

 

 

ExcelDemy
Logo