如EXCEL A1图片名称,图片的路径都在D:\123 怎么查找A列的图片是否存在?
楼主如果真的需要,可以在 VBE 编辑环境下使用 VBA 代码来实现。追问
有VBA使用什么代码?
追答 你可以使用 Dir 函数,就像在 DOS 系统下使用 DIR 命令一样。下面是 Dir 函数的说明。虽然是 OFFICE2013 下的说明,但在以前的OFFICE 版本下一样使用:
Dir Function
Returns a String representing the name of a file, directory, or folder that matches a specified pattern or file attribute, or the volume label of a drive.
Syntax
Dir[(pathname[, attributes])]
The Dir function syntax has these parts:
pathname
Optional. String expression that specifies a file name — may include directory or folder, and drive. A zero-length string ("") is returned if pathname is not found.
attributes
Optional. Constant or numeric expression, whose sum specifies file attributes. If omitted, returns files that match pathname but have no attributes.