Function PBRF(BrojRac As String) As String Dim MyTime(1 To 2), traje Dim i As Integer Dim t Set t = Application.FileSearch With t .NewSearch .LookIn = "C:\temp\Printed" .FileName = "RACUN*" '& BrojRac & ".IN$" .FileType = 1 MyTime(1) = Time If .Execute() > 0 Then MyTime(2) = Time traje = Format(MyTime(2) - MyTime(1), "h:m:s") MsgBox traje MsgBox "There were " & .FoundFiles.Count & _ " file(s) found." For i = 1 To .FoundFiles.Count MsgBox .FoundFiles(i) Next i Else MsgBox "There were no files found." End If End With End Function