View Single Post
  #5   Report Post  
Posted to microsoft.public.excel.programming
Stuart[_3_] Stuart[_3_] is offline
external usenet poster
 
Posts: 50
Default Make excel check external file paths

Where should this text be pasted into?

Thanks

Stuart


Robert Bruce wrote:
Roedd <<Stefi wedi ysgrifennu:

Use this UDF! Insert it in a normal module!
Public Function FileExists(fname) As Boolean
FileExists = IIf(Dir(fname) < "", True, False)
End Function

Insert in B1: =FileExists(A1) and drag it down as required!


Or , more simply:

Public Function FileExists1(fname) As Boolean
FileExists1 = Len(Dir(fname)) 0
End Function

Rob