Pages

Wednesday, April 20, 2011

UDF to check file exits or not

If you want to check file exists or not . Try this UDF




Function file_exists(fl_path As String) As String
    If Dir(fl_path) <> "" And fl_path <> "" Then
        file_exists = "Exists"
    Else
        file_exists = "Not Exists"
    End If





Download Working File



Steps to Use
  • Copy the below code
  • Press Alt+F11 to open VBA editor
  • Paste it in any public module or module 1
  • For example you have complete file path in Cell A1  and in cell B1 you want to know whether file exists or not . In cell B1 type =file_exists(A1) .

No comments:

Post a Comment