You are viewing the article How to Insert a Picture into Excel to Automatically Fit Cells at Lassho.edu.vn you can quickly access the necessary information in the table of contents of the article below.
This article is co-authored by a team of editors and trained researchers who confirm the accuracy and completeness of the article.
The wikiHow Content Management team carefully monitors the work of editors to ensure that every article is up to a high standard of quality.
This article has been viewed 26,760 times.
Do you want to add an image or logo to your Excel spreadsheet to make the content more visually appealing? While there’s no automatic setting to resize images inside cells, you can do it yourself with just a few clicks. This wikiHow teaches you how to insert pictures into Excel and resize them to fit cells.
Steps
- Change the Height and Width parameters, or drag and drop the corners on the image to adjust the size.
- Right-click the image and select Format Picture . Then, click the “Size & Properties” tab (the green square icon and the multi-directional arrows inside) and then select Move and size with cells . cells).
-
- You can also use VBA code after you have inserted some pictures. Insert an image, then press Alt + F11 to open the VBA window. Click Insert > Module and paste the following code:
-
- Press F5 to execute the code and repeat this process until all the pictures in the worksheet have fit in the cells.
Public Sub FitPic() On Error GoTo NOT_SHAPE Dim PicWtoHRatio As Single Dim CellWtoHRatio As Single With Selection PicWtoHRatio = .Width / .Height End With With Selection.TopLeftCell CellWtoHRatio = .Width / .RowHeight End With Select Case PicWtoHRatio / CellWtoHRatio Case Is > 1 With Selection .Width = .TopLeftCell.Width .Height = .Width / PicWtoHRatio End With Case Else With Selection .Height = .TopLeftCell.RowHeight .Width = .Height * PicWtoHRatio End With End Select With Selection .Top = .TopLeftCell.Top .Left = .TopLeftCell.Left End With Exit Sub NOT_Shape: MsgBox "Select a picture before running this macro." End Sub
-
This article is co-authored by a team of editors and trained researchers who confirm the accuracy and completeness of the article.
The wikiHow Content Management team carefully monitors the work of editors to ensure that every article is up to a high standard of quality.
This article has been viewed 26,760 times.
Do you want to add an image or logo to your Excel spreadsheet to make the content more visually appealing? While there’s no automatic setting to resize images inside cells, you can do it yourself with just a few clicks. This wikiHow teaches you how to insert pictures into Excel and resize them to fit cells.
Thank you for reading this post How to Insert a Picture into Excel to Automatically Fit Cells at Lassho.edu.vn You can comment, see more related articles below and hope to help you with interesting information.
Related Search: