我有一个Excel电子表格。我在单元格A1,B1,C1中有3张不同的图片。 单元格D1具有值(一,二或三)。根据D1中的值,我需要单元格E1在单元格A1,A2或A3中显示图片
像这样if(d1="one"; display the picture in A1)
if(d1="two"; display the picture in B1)
if(d1="three"; display the picture in C
任何想法如何根据IF功能显示图片?
答案 0 :(得分:0)
Select Case Range("D1")
Case one
ActiveSheet.Shapes("Picture 1").Visible = True
ActiveSheet.Shapes("Picture 2").Visible = False
ActiveSheet.Shapes("Picture 3").Visible = False
Case two
ActiveSheet.Shapes("Picture 1").Visible = False
ActiveSheet.Shapes("Picture 2").Visible = True
ActiveSheet.Shapes("Picture 3").Visible = False
Case three
ActiveSheet.Shapes("Picture 1").Visible = False
ActiveSheet.Shapes("Picture 2").Visible = False
ActiveSheet.Shapes("Picture 3").Visible = True
End Select
将图片名称更改为图片名称。