我在excel表中有图像名称:
16094_1.jpg
16095_1.jpg,16095_2.jpg
在逗号分隔的单元格中,名称可以是单个或多个。 它们存储在位置
"C:\Users\Jatin\Desktop\Jatin\november\17-nov\images"
我想创建用户定义的函数(公式) 可以在所需位置找到图像,无论它们是否存在。 例如,
=findimage("path",imagename)
=findimage("C:\Users\Jatin",a1)
答案 0 :(得分:2)
Function hasImages(Path As String, ImageList As String)
Dim results
Dim x As Long
results = Split(ImageList, ",")
If Not Right(Path, 1) = "\" Then Path = Path & "\"
For x = 0 To UBound(results)
results(x) = Len(Dir(Path & results(x))) > 0
Next
hasImages = Join(results, ",")
End Function
答案 1 :(得分:1)
您可以尝试使用此功能:
TaskContext