[vba]Sub M_snb()
MsgBox F_snb("G:\OF", "codeA")
End Sub[/vba]

[vba]Function F_snb(ParamArray sq())
sn = Filter(Split(CreateObject("wscript.shell").exec("cmd /c Dir " & sq(0) & "\*. /b /s").StdOut.ReadAll, vbCrLf), sq(1))
If UBound(sn) > -1 Then F_snb = sn(0)
End Function[/vba]