如何让图像在Excel中显示出来?

时间:2022-09-03 23:31:44

I'm creating a csv file with one of the columns containing an url of an image (e.g., www.myDomain.com/myImage.jpg).
How I can get Excel to render this image?

我正在创建一个csv文件,其中一列包含一个图像的url(例如,www.myDomain.com/myImage.jpg)。如何使用Excel渲染这个图像?

2 个解决方案

#1


19  

Dim url_column As Range
Dim image_column As Range

Set url_column = Worksheets(1).UsedRange.Columns("A")
Set image_column = Worksheets(1).UsedRange.Columns("B")

Dim i As Long
For i = 1 To url_column.Cells.Count

  With image_column.Worksheet.Pictures.Insert(url_column.Cells(i).Value)
    .Left = image_column.Cells(i).Left
    .Top = image_column.Cells(i).Top
    image_column.Cells(i).EntireRow.RowHeight = .Height
  End With

Next

#2


-1  

On Google Sheets you can add the IMAGE(url) method to your CSV file and it will be rendered (Tested on Google Sheets).

在谷歌表上,您可以将IMAGE(url)方法添加到CSV文件中,并将其呈现(在谷歌表上进行测试)。

Here is an example:

这是一个例子:

=IMAGE("http://efdreams.com/data_images/dreams/lion/lion-03.jpg")

#1


19  

Dim url_column As Range
Dim image_column As Range

Set url_column = Worksheets(1).UsedRange.Columns("A")
Set image_column = Worksheets(1).UsedRange.Columns("B")

Dim i As Long
For i = 1 To url_column.Cells.Count

  With image_column.Worksheet.Pictures.Insert(url_column.Cells(i).Value)
    .Left = image_column.Cells(i).Left
    .Top = image_column.Cells(i).Top
    image_column.Cells(i).EntireRow.RowHeight = .Height
  End With

Next

#2


-1  

On Google Sheets you can add the IMAGE(url) method to your CSV file and it will be rendered (Tested on Google Sheets).

在谷歌表上,您可以将IMAGE(url)方法添加到CSV文件中,并将其呈现(在谷歌表上进行测试)。

Here is an example:

这是一个例子:

=IMAGE("http://efdreams.com/data_images/dreams/lion/lion-03.jpg")