跳到主要內容

如何在Excel中一次插入多張圖片並調整其大小?

我們很容易在Excel中插入一張圖片,但是如果您需要一次插入多張圖片以節省大量時間,該怎麼辦?


插入多張圖片,並通過“插入圖片”功能批量調整它們的大小

我們可以通過Excel中的(插入)圖片功能批量插入多張圖片,然後同時調整它們的大小。 請執行以下操作:

1。 在工作表中,單擊 插入 > 圖片.

2。 在“插入圖片”對話框中,請打開包含要插入圖片的文件夾,根據需要選擇多張圖片,然後單擊 插入 按鈕。 看截圖:
備註:控股 按Ctrl 鍵,您可以選擇多幅不相鄰的圖片,一幅一幅地單擊它們; 保持 轉移 鍵,單擊第一張和最後一張可以選擇多張相鄰的圖片。

現在,圖片將批量插入並堆疊在工作表中。

3。 保持選中這些圖片,並通過在兩個圖片中輸入新數字來批量調整它們的大小 信號寬度身高 中的框 尺寸 組上 格式 標籤。 看截圖:

現在,所有插入的圖片會立即同時更改為相同大小。

4。 目前,您需要手動將每張圖片分別移動到合適的位置。

備註:如果有數十張照片堆疊在一起,則手動將它們移動到合適的位置將非常耗時。

在Excel中批量插入與單元格內容匹配的多張圖片

匹配導入圖片 Kutools for Excel的功能是一個很棒的工具,它可以基於單元格內容批量導入和插入多張圖片,並可以輕鬆地將與單元格大小相同或指定大小的導入圖片調整為大小。


廣告匹配導入圖片01

Excel的Kutools - 使用 300 多種基本工具增強 Excel 功能。 享受全功能 30 天免費試用,無需信用卡! 立即行動吧!

插入多張圖片並使用OneNote批量調整它們的大小

為避免一張一張地移動堆疊的圖片,此方法引入了另一種技巧,即藉助OneNote插入多張圖片。 請執行以下操作:

1。 啟動OneNote,然後創建一個新頁面。 然後點擊 插入 > 圖片.

2。 在“插入圖片”對話框中,請打開包含要插入圖片的文件夾,根據需要選擇多張圖片,然後單擊 插入 按鈕。 看截圖:
備註:控股 按Ctrl 鍵,您可以選擇多幅不相鄰的圖片,一幅一幅地單擊它們; 保持 轉移 鍵,單擊第一張和最後一張可以選擇多張相鄰的圖片。

doc插入多張圖片OneNote 032

3。 按 按Ctrl + A 鍵以選擇OneNote中所有插入的圖片,然後按 按Ctrl + C 複製它們的鍵。

4。 在Excel中轉到工作表,然後按 按Ctrl + V 鍵將圖片粘貼到工作表中。 現在,所有圖片都被垂直粘貼,如左圖所示。

5. 選擇任何一張圖片,然後按 按Ctrl + A 鍵選擇所有這些。 然後通過在兩者中輸入新數字來批量調整圖片大小 信號寬度身高 中的框 尺寸 組上 格式 標籤。 看截圖:

現在,所有指定的圖片都將插入到Excel中,並批量調整為相同大小。


使用VBA代碼將多張圖片插入Excel

使用以下VBA代碼,您可以將多個圖片逐個單元插入Excel文件。

1。 選擇要插入圖片的目的地範圍的第一個單元格。

2。 按住 ALT + F11 鍵,然後打開 Microsoft Visual Basic for Applications 窗口。

3。 點擊 插入 > 模塊,然後將以下宏粘貼到 模塊窗口.

Sub InsertPictures()
'Update 20140513
Dim PicList() As Variant
Dim PicFormat As String
Dim Rng As Range
Dim sShape As Shape
On Error Resume Next
PicList = Application.GetOpenFilename(PicFormat, MultiSelect:=True)
xColIndex = Application.ActiveCell.Column
If IsArray(PicList) Then
    xRowIndex = Application.ActiveCell.Row
    For lLoop = LBound(PicList) To UBound(PicList)
        Set Rng = Cells(xRowIndex, xColIndex)
        Set sShape = ActiveSheet.Shapes.AddPicture(PicList(lLoop), msoFalse, msoCTrue, Rng.Left, Rng.Top, Rng.Width, Rng.Height)
        xRowIndex = xRowIndex + 1
    Next
End If
End Sub

4。 然後按 F5 運行此代碼的關鍵。

5。 在“打開”對話框中,請打開包含要插入圖片的文件夾,選擇要插入的多張圖片,然後單擊 已提交 按鈕。 並且所有選擇的圖片已根據像元大小導入到您的選擇中。 看截圖:


插入多張圖片並使用Kutools for Excel自動調整它們

Excel的Kutools導入圖片 實用程序可以幫助您根據單元格大小或圖片大小將多張圖片快速插入Excel。 您也可以根據需要指定圖片的高度和寬度。

Excel的Kutools - 使用 300 多種基本工具增強 Excel 功能。 享受全功能 30 天免費試用,無需信用卡! 立即行動吧!

1。 點擊 Kutools 加 > 導入/導出 > 導入圖片,請參見屏幕截圖:

2。 在 導入圖片 對話框,請執行以下操作:
(1)從 進口訂單 下拉列表,您可以選擇 垂直填充單元格 or 逐個單元格水平填充.
(2)點擊 加入 按鈕選擇圖像文件或文件夾以將圖片添加到“圖片”列表中。 並且所有選擇的圖片將在列錶框中列出。
(3)點擊 進口尺寸 按鈕;

3。 現在在 導入圖片尺寸 在對話框中,您可以選擇符合您需要的圖片尺寸。 看截圖:

4。 指定圖片尺寸後,請點擊 OK 關閉此對話框,然後返回 導入圖片 對話框中單擊 進口 按鈕導入圖像。

5。 在新的“導入圖片”對話框中,請選擇要插入圖片的目標範圍的第一個單元格,然後單擊 OK 按鈕。

目前,所有選擇的圖片已從活動單元垂直或水平插入到單元中。 見右圖:

導入圖片 Kutools for Excel的功能旨在在Excel中同時插入一批具有匹配單元格大小,指定大小或圖片自己大小的圖片。 免費試用!


使用Kutools for Excel插入多張與其名稱匹配的圖片

Kutools for Excel還支持戲劇性 匹配導入圖片 功能以匹配圖片和單元格內容,並僅在Excel中批量插入匹配的圖片。

Excel的Kutools - 使用 300 多種基本工具增強 Excel 功能。 享受全功能 30 天免費試用,無需信用卡! 立即行動吧!

1。 選擇要插入其匹配圖片的圖片名稱單元格,然後單擊 Kutools 加 > 導入/導出 > 匹配導入圖片。 看截圖:

2。 在彈出的“匹配導入圖片”對話框中,請執行以下操作:
(1)從 進口訂單 下拉列表;
(2)點擊 加入 按鈕將圖片添加到圖片列錶框中。 供您參考,僅列出匹配的圖片。
(3)然後點擊 進口尺寸 按鈕。

3. 現在在 導入圖片尺寸 對話框中,您可以選擇符合您需要的圖片尺寸,然後點擊 Ok 按鈕。 看截圖:

4。 現在您回到 導入圖片 對話框中單擊 進口 按鈕導入圖像。

5.在彈出的“匹配導入圖片”對話框中,指定要插入圖片的目標範圍的第一個單元格,然後單擊 OK 按鈕。 看截圖:

到目前為止,所有圖片均根據其相對名稱插入到單元格中。 見右圖:

匹配導入圖片 Kutools for Excel的功能可以幫助Excel用戶根據單元格值快速過濾圖片,然後批量插入這些圖片。 此外,可以將這些匹配的圖片自動調整為指定的大小或像元大小。 免費試用!


演示:插入多張圖片並在Excel中一次調整它們的大小

Excel的Kutools 包含 300 多種 Excel 便捷工具,30 天內免費試用,無限制。 立即免費試用!      現在購買!


相關文章

最佳辦公生產力工具

🤖 Kutools 人工智慧助手:基於以下內容徹底改變數據分析: 智慧執行   |  生成代碼  |  建立自訂公式  |  分析數據並產生圖表  |  呼叫 Kutools 函數...
熱門特色: 尋找、突出顯示或識別重複項   |  刪除空白行   |  合併列或儲存格而不遺失數據   |   沒有公式的回合 ...
超級查詢: 多條件VLookup    多值VLookup  |   跨多個工作表的 VLookup   |   模糊查詢 ....
高級下拉列表: 快速建立下拉列表   |  依賴下拉列表   |  多選下拉列表 ....
欄目經理: 新增特定數量的列  |  移動列  |  切換隱藏列的可見性狀態  |  比較範圍和列 ...
特色功能: 網格焦點   |  設計圖   |   大方程式酒吧    工作簿和工作表管理器   |  資源庫 (自動文字)   |  日期選擇器   |  合併工作表   |  加密/解密單元格    按清單發送電子郵件   |  超級濾鏡   |   特殊過濾器 (過濾粗體/斜體/刪除線...)...
前 15 個工具集12 文本 工具 (添加文本, 刪除字符,...)   |   50+ 圖表 類型 (甘特圖,...)   |   40+ 實用 公式 (根據生日計算年齡,...)   |   19 插入 工具 (插入二維碼, 從路徑插入圖片,...)   |   12 轉化 工具 (數字到單詞, 貨幣兌換,...)   |   7 合併與拆分 工具 (高級合併行, 分裂細胞,...)   |   ... 和更多

使用 Kutools for Excel 增強您的 Excel 技能,體驗前所未有的效率。 Kutools for Excel 提供了 300 多種進階功能來提高生產力並節省時間。  點擊此處獲取您最需要的功能...

產品描述


Office選項卡為Office帶來了選項卡式界面,使您的工作更加輕鬆

  • 在Word,Excel,PowerPoint中啟用選項卡式編輯和閱讀,發布者,Access,Visio和Project。
  • 在同一窗口的新選項卡中而不是在新窗口中打開並創建多個文檔。
  • 將您的工作效率提高 50%,每天為您減少數百次鼠標點擊!
Comments (47)
No ratings yet. Be the first to rate!
This comment was minimized by the moderator on the site
Hello community,

Thank you very much - this is a great tool!
But for my request, I should keep the sizes of the images, which are different. Is there any way to keep the format of the images but keep the functions with this code?

Many thanks in advance.
Elias
This comment was minimized by the moderator on the site
Respected sir, i want to One image paste on specific cell more than one in a time.
This comment was minimized by the moderator on the site
Hello, Sarfraz

If you want to insert one image into multiple cells, you just need to insert one image and resize it, and then copy and paste it to the other cells as you need.

Thank you!
This comment was minimized by the moderator on the site
mình cảm ơn vì bài viết. mình có làm danh sách sản phẩm hàng hóa mất rất nhiều thời gian nhưng chợt thấy chenanhexcel.com có bán add-in thì công việc của mình dễ dàng hơn nhiều.
This comment was minimized by the moderator on the site
Hi, i have 10 images i want to insert all 10 inside ONE CELL in excel. is this possible and if so pls help me out with some code pls...
This comment was minimized by the moderator on the site
Hi Vind,
First, adjust the cell and make it big enough to contain the 10 images.
Then Click Insert > Picture to open the Insert Picture dialog. In the dialog, select the 10 images together (if they are in the same folder), and click the OK button.
Now all images are inserted. If necessary, resize them simultaneously in the Size group on the Picture Format tab.
These images are inserted in the diagonal line of the cell as attached picture, and you need to adjust their positions manually.
This comment was minimized by the moderator on the site
I am using the following code, which came from Funzone, to add my photos but i need to be able to skip a column, leaving a blank column between photos, can someone help?

Sub InsertPictures()
Dim PicList() As Variant
Dim PicFormat As String
Dim Rng As Range
Dim sShape As Shape
On Error Resume Next
PicList = Application.GetOpenFilename(PicFormat, MultiSelect:=True)

xColIndex = Application.ActiveCell.Column
xRowIndex = Application.ActiveCell.Row

If IsArray(PicList) Then

For lLoop = LBound(PicList) To UBound(PicList)
Set Rng = Cells(xRowIndex, xColIndex)
Set sShape = ActiveSheet.Shapes.AddPicture(PicList(lLoop), msoFalse, msoCTrue, Rng.Left, Rng.Top, Rng.Width, Rng.Height)
xColIndex = xColIndex + 1
If xColIndex = 4 Then GoTo Continue1 Else GoTo Continue2

Continue1:
xRowIndex = xRowIndex + 2
xColIndex = xColIndex - 3

Continue2:
Next
End If
End Sub
This comment was minimized by the moderator on the site
I was finally able to figure it out on my own.

The code below will insert 3 pictures horizontally in the columns then move down a row and insert 3 more horizontally it will repeat this process until it runs out of the selected pictures.



Sub InsertPictures()
Dim PicList() As Variant
Dim PicFormat As String
Dim Rng As Range
Dim sShape As Shape
On Error Resume Next
PicList = Application.GetOpenFilename(PicFormat, MultiSelect:=True)

xColIndex = Application.ActiveCell.Column
xRowIndex = Application.ActiveCell.Row

If IsArray(PicList) Then

For lLoop = LBound(PicList) To UBound(PicList)
Set Rng = Cells(xRowIndex, xColIndex)
Set sShape = ActiveSheet.Shapes.AddPicture(PicList(lLoop), msoFalse, msoCTrue, Rng.Left, Rng.Top, Rng.Width, Rng.Height)
xColIndex = xColIndex + 1
If xColIndex = 4 Then GoTo Continue1 Else GoTo Continue2

Continue1:
xRowIndex = xRowIndex + 1
xColIndex = xColIndex - 3

Continue2:
Next
End If
End Sub
This comment was minimized by the moderator on the site
I would really like to use this VBA code to fill an array of cells with picture like 5 across then move to next row and 5 across until you run out of selected pictures but I just can't wrap my head around how to do it. Is this at all possible?


If you know how to do this please post the code. Thank you In advance!

Similar to https://www.extendoffice.com/documents/excel/3360-excel-transpose-every-5-rows.html
except by selecting pictures and pasting the output in an array.
This comment was minimized by the moderator on the site
I would really like to use this VBA code to fill an array of cells with picture like 5 across then move to next row and 5 across until you run out of selected pictures but I just can't wrap my head around how to do it. Is this at all possible?

Similar to https://www.extendoffice.com/documents/excel/3360-excel-transpose-every-5-rows.html
except by selecting pictures and pasting the output in an array
This comment was minimized by the moderator on the site
les agradezco mucho realmente ayudan muchisimo con el trabajo y el tiempo. Me sirvio perfecto para un inventario con fotos.
reitero mi agradecimiento
This comment was minimized by the moderator on the site
Tried this code and in all honesty is amazing and fast, however is there any chance of amending this to make it resize the pictures to a custom size.
I cannot seem to get my head around it.
Thanks
There are no comments posted here yet
Load More
Please leave your comments in English
Posting as Guest
×
Rate this post:
0   Characters
Suggested Locations