Is there anyone who knows how to connect a picture with the cell that it is in at microsoft excel?
是否有人知道如何将图片与它在microsoft excel中的单元格连接?
For example in the first column I put some brands of mobile phones and in the second one some pictures of them. Now when I sort the values of the first column alphabetically, I want the pictures of the second one to keep up…
例如,在第一列中我放了一些品牌的手机,在第二列中我放了一些照片。现在,当我按字母顺序排列第一列的值时,我希望第二列的图片能够跟上...
How can I do that?
我怎样才能做到这一点?
3 个解决方案
#1
15
There is a much simpler way. Put your picture in a comment box within the description cell. That way you only have one column and when you sort the picture will always stay with the description. Okay... Right click the cell containing the description... Insert comment...right click the outer border... Format comment...colours and lines tab... Colour drop down...Fill effects...Picture tab...select picture...browse for your picture (it might be best to keep all pictures in one folder for ease of placement)...ok... you will probably need to go to the size tab and frig around with the height and width. Done... You now only need to mouse over the red in the top right corner of the cell and the picture will appear...like magic.
有一种更简单的方法。将您的图片放在描述单元格的注释框中。这样你只有一列,当你对图片进行排序时,它将始终与描述保持一致。好的...右键单击包含描述的单元格...插入注释...右键单击外边框...格式注释...颜色和线条选项卡...颜色下拉...填充效果...图片选项卡...选择图片...浏览你的图片(最好将所有图片保存在一个文件夹中以便于放置)...好吧......你可能需要去尺寸标签和frig高度和宽度。完成...你现在只需要将鼠标悬停在单元格右上角的红色上,图片就会出现......就像魔法一样。
This method means that the row height can be kept to a minimum and the pictures can be as big as you like.
此方法意味着行高可以保持最小,图片可以随意大小。
#2
2
Hold down the Alt key and drag the pictures to snap to the upper left corner of the cell.
按住Alt键并拖动图片以捕捉到单元格的左上角。
Format the picture and in the Properties tab select "Move but don't size with cells"
格式化图片,然后在“属性”选项卡中选择“移动但不要使用单元格调整大小”
Now you can sort the data table by any column and the pictures will stay with the respective data.
现在,您可以按任意列对数据表进行排序,并且图片将保留各自的数据。
This post at SuperUser has a bit more background and screenshots: https://superuser.com/questions/712622/put-an-equation-object-in-an-excel-cell/712627#712627
SuperUser上的这篇文章有更多背景和截图:https://superuser.com/questions/712622/put-an-equation-object-in-an-excel-cell/712627#712627
#3
1
Select both the column you are sorting, and the column that the picture is in (I am assuming the picture is small compared to the cell, i.e. it is "in" the cell). Make sure that the object positioning property is set as "move but don't size with cells". Now if you do a sort, the pictures will move with the list being sorted.
选择要排序的列和图片所在的列(我假设图片与单元格相比较小,即它在单元格中“)”。确保将对象定位属性设置为“移动但不用单元格大小”。现在,如果您进行排序,图片将随着列表的排序而移动。
Note - you must include the column with the picture in your range when you sort, and the picture must fit inside the cell.
注意 - 排序时,必须在列中包含图片,并且图片必须适合单元格。
The following VBA snippet will make sure all pictures in your spreadsheet have their "move and size" property set:
以下VBA代码段将确保电子表格中的所有图片都设置了“移动和尺寸”属性:
Sub moveAndSize()
Dim s As Shape
For Each s In ActiveSheet.Shapes
If s.Type = msoPicture Or s.Type = msoLinkedPicture Or s.Type = msoPlaceholder Then
s.Placement = xlMove
End If
Next
End Sub
If you want to make sure the picture continues to fit after you move it, you can use xlMoveAndSize
instead of xlMove
.
如果要在移动后确保图片继续适合,可以使用xlMoveAndSize而不是xlMove。
#1
15
There is a much simpler way. Put your picture in a comment box within the description cell. That way you only have one column and when you sort the picture will always stay with the description. Okay... Right click the cell containing the description... Insert comment...right click the outer border... Format comment...colours and lines tab... Colour drop down...Fill effects...Picture tab...select picture...browse for your picture (it might be best to keep all pictures in one folder for ease of placement)...ok... you will probably need to go to the size tab and frig around with the height and width. Done... You now only need to mouse over the red in the top right corner of the cell and the picture will appear...like magic.
有一种更简单的方法。将您的图片放在描述单元格的注释框中。这样你只有一列,当你对图片进行排序时,它将始终与描述保持一致。好的...右键单击包含描述的单元格...插入注释...右键单击外边框...格式注释...颜色和线条选项卡...颜色下拉...填充效果...图片选项卡...选择图片...浏览你的图片(最好将所有图片保存在一个文件夹中以便于放置)...好吧......你可能需要去尺寸标签和frig高度和宽度。完成...你现在只需要将鼠标悬停在单元格右上角的红色上,图片就会出现......就像魔法一样。
This method means that the row height can be kept to a minimum and the pictures can be as big as you like.
此方法意味着行高可以保持最小,图片可以随意大小。
#2
2
Hold down the Alt key and drag the pictures to snap to the upper left corner of the cell.
按住Alt键并拖动图片以捕捉到单元格的左上角。
Format the picture and in the Properties tab select "Move but don't size with cells"
格式化图片,然后在“属性”选项卡中选择“移动但不要使用单元格调整大小”
Now you can sort the data table by any column and the pictures will stay with the respective data.
现在,您可以按任意列对数据表进行排序,并且图片将保留各自的数据。
This post at SuperUser has a bit more background and screenshots: https://superuser.com/questions/712622/put-an-equation-object-in-an-excel-cell/712627#712627
SuperUser上的这篇文章有更多背景和截图:https://superuser.com/questions/712622/put-an-equation-object-in-an-excel-cell/712627#712627
#3
1
Select both the column you are sorting, and the column that the picture is in (I am assuming the picture is small compared to the cell, i.e. it is "in" the cell). Make sure that the object positioning property is set as "move but don't size with cells". Now if you do a sort, the pictures will move with the list being sorted.
选择要排序的列和图片所在的列(我假设图片与单元格相比较小,即它在单元格中“)”。确保将对象定位属性设置为“移动但不用单元格大小”。现在,如果您进行排序,图片将随着列表的排序而移动。
Note - you must include the column with the picture in your range when you sort, and the picture must fit inside the cell.
注意 - 排序时,必须在列中包含图片,并且图片必须适合单元格。
The following VBA snippet will make sure all pictures in your spreadsheet have their "move and size" property set:
以下VBA代码段将确保电子表格中的所有图片都设置了“移动和尺寸”属性:
Sub moveAndSize()
Dim s As Shape
For Each s In ActiveSheet.Shapes
If s.Type = msoPicture Or s.Type = msoLinkedPicture Or s.Type = msoPlaceholder Then
s.Placement = xlMove
End If
Next
End Sub
If you want to make sure the picture continues to fit after you move it, you can use xlMoveAndSize
instead of xlMove
.
如果要在移动后确保图片继续适合,可以使用xlMoveAndSize而不是xlMove。