excel 怎么用函数查找电脑里的文件是否存在?

如EXCEL A1图片名称,图片的路径都在D:\123 怎么查找A列的图片是否存在?

据我所知,Excel 自身没有查找文件名的内部函数,因为那些都是操作系统的功能,需要的时候通过调用操作系统相应的功能就行了。
楼主如果真的需要,可以在 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.   

温馨提示:答案为网友推荐,仅供参考

相关了解……

你可能感兴趣的内容

本站内容来自于网友发表,不代表本站立场,仅表示其个人看法,不对其真实性、正确性、有效性作任何的担保
相关事宜请发邮件给我们
© 非常风气网