跳到主要內容

如何基於Excel中的單元格值在單元格中動態插入圖像或圖片?

在許多情況下,您可能需要根據單元格值在單元格中動態插入圖像。 例如,您希望使用您在指定單元格中輸入的不同值動態更改相應的圖像。 本文將向您展示如何實現它。

根據您在單元格中輸入的值動態插入和更改圖像
使用驚人的工具根據單元格值動態更改圖像


根據您在單元格中輸入的值動態插入和更改圖像

如下面的屏幕截圖所示,您要基於在單元格G2中輸入的值動態顯示相應的圖片。 在單元格G2中輸入“香蕉”時,香蕉圖片將顯示在單元格H2中。 在單元格G2中輸入菠蘿時,單元格H2中的圖片將變成相應的菠蘿圖片。

1.在工作表中創建兩列,第一列範圍 A2:A4 包含圖片名稱和第二列範圍 B2:B4 包含相應的圖片。 請參閱顯示的屏幕截圖。

2。 點擊 公式 > 名稱管理員.

3。 在裡面 名稱管理員 對話框中,單擊 全新 按鈕。 那麼 編輯名稱 彈出對話框,輸入 產品 姓名 框中,將以下公式輸入 框,然後單擊 OK 按鈕。 看截圖:

=INDIRECT(ADDRESS(2-1+MATCH(Sheet2!$G$2, Sheet2!$A$2:$A$4, 0), 2))

筆記:

1)。 在公式中,第一個數字 2 是您的第一個產品的行號。 在這種情況下,我的第一個產品名稱位於第2行。
2)。 Sheet2!$ G $ 2 是您要基於其動態更改相應圖像的單元格。
3)。 Sheet2!$ A $ 2:$ A $ 4 是您在當前工作表中的產品名稱列表。
4)。 最後一個號碼 2 是包含您的圖像的列號。

您可以根據需要在上述公式中更改它們。

4。 關上 名稱管理員 對話框。

5.在“圖片”列中選擇一張圖片,然後按 按Ctrl + C 同時復制鍵。 然後將其粘貼到當前工作表中的新位置。 在這裡,我複制蘋果圖片並將其放在單元格H2中。

6.在單元格G2中輸入一個水果名稱(例如Apple),單擊以選擇粘貼的圖片,然後輸入公式 =產品配方欄,然後按 Enter 鍵。 看截圖:

從現在開始,當更改為G2單元格中的任何水果名稱時,H2單元格中的圖片將動態變為對應的水果名稱。

您可以通過在G2單元格中創建一個包含所有水果名稱的下拉列表來快速選擇水果名稱,如下圖所示。


使用驚人的工具根據單元格值輕鬆將圖像插入相關單元格

對於很多Excel新手來說,上面的方法並不好駕馭。 這裡推薦 圖片下拉列表 的特點 Excel的Kutools. 使用此功能,您可以輕鬆創建值和圖片完全匹配的動態下拉列表。

申請前 Excel的Kutools首先下載並安裝.

請按以下步驟應用 Kutools for Excel 的圖片下拉列表功能在 Excel 中創建動態圖片下拉列表。

1.首先,您需要分別創建兩列,分別包含值及其對應的圖片,如下圖所示。

2。 點擊 庫工具 > 進出口 > 匹配導入圖片.

3。 在裡面 圖片下拉列表 對話框,您需要配置如下。

3.1) 如果您已經在上面的步驟 1 中創建了值和圖片列,請忽略此步驟;
3.2)在 Step2 部分,選擇您創建的兩列;
3.3)在 Step3 部分,選擇輸出動態圖片的範圍下拉列表。
注意: In Step3 部分,您需要選擇兩列來放置結果。 一列用於值,另一列用於相應的圖片。
3.4)點擊 確定。

4.然後 Excel的Kutools 彈出對話框提醒您在此過程中會創建一些中間數據,點擊 以繼續。

然後創建一個動態圖片下拉列表。 圖片將根據您在下拉列表中選擇的項目動態更改。

點擊即可 了解有關此功能的更多信息...

  如果您想免費試用(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 (15)
No ratings yet. Be the first to rate!
This comment was minimized by the moderator on the site
Can this be paired up with excel Queries?
This comment was minimized by the moderator on the site
Hi Maxem,
The methods can't be paired up with Excel queries, and I have not been able to fix the problem. Sorry for the inconvenience.
This comment was minimized by the moderator on the site
What if the cell value we take to change the picture has more than one word. Like a company name and logo
This comment was minimized by the moderator on the site
How can I, if no value is entered, reset to a defaut image (or nothing)?Thanks
This comment was minimized by the moderator on the site
Hi Admin
Thanks for sharing very good article. Could you please tell me, In Ist procedure step 6, I want to enter value for G2 through a user form. Is it possible? Please help
This comment was minimized by the moderator on the site
Good day,
Sorry, the user form does not take into consideration in this case.
This comment was minimized by the moderator on the site
Could this be used instead of conditional formatting icon sets?
I need a green down arrow and red up arrow based on percentages from other cells.


If so, how would I go about completing this?

I'm needing negative percentages (<0%) to show a red up arrow,
Neutral percentages (=0%) to show a yellow bracket. (can already be done with conditional formatting),
Positive percentages (>=0.001%) to show a green down arrow.



How would I achieve this?
This comment was minimized by the moderator on the site
Dear Jason,
Sorry i don't have methd for this question.
This comment was minimized by the moderator on the site
Looks really great! But I need it to auto fill a cell (B1) with a picture when I type something in cell A1. Is this possible? and can we change max file count in folder? Have one with 15.000 pics, max is 10000.

Thanks! Love to hear from you@!
This comment was minimized by the moderator on the site
Guido, the problem you mentioned cannot be solved. Sorry about that!
This comment was minimized by the moderator on the site
Can you please tell, how can this be looped for over 600 rows. Here in this tutorial, it changes picture based on only one cell, I need the same for multiple cells, do I need to make separate "Product" lists for that in "Name Manager", because that lists is over 600.
This comment was minimized by the moderator on the site
Dear Nick,

Sorry to tell you that this method can't be looped for multiple cells. You need to specify =Product formula to all needed pictures one by one manually in your case.
Thank you for your comment!
This comment was minimized by the moderator on the site
This is awesome, is there a way of creating a lookup formula on another worksheet that will look up the name and return the picture into the selected cell?
This comment was minimized by the moderator on the site
Hey Nick did you get how to do it, when you want to have the list of the pictures on other sheet?
This comment was minimized by the moderator on the site
Great article, really helpful for something I'm trying to do. How would you change the formula in step 3 if all of the images and names were on another worksheet? Many thanks.
There are no comments posted here yet
Please leave your comments in English
Posting as Guest
×
Rate this post:
0   Characters
Suggested Locations