==========
Hi Rich,
You can do this with a user defined function ( a bit like a macro but can be used as any other function from Excel)
You need to go to VBE Alt+F11
Then paste in the following function into a module.
Function IsItThere(usname)
IsItThere = 0
flet = Left(usname, 1)
fnam = usname & ".ini"
sfol = "U:\Path_To_My_Files\" & flet
With Application.FileSearch
.NewSearch
.LookIn = sfol
.SearchSubFolders = False
.FileName = fnam
.MatchTextExactly = True
.FileType = msoFileTypeAllFiles
If .Execute() > 0 Then IsItThere = 1
End With
End Function
Next you need to change the Path to My Files to your own path and then you are ready to use the function in Excel.
Go back to Excel.
I am assuming your user names are in column A starting in row 2, and your test is in Col B.
Enter the formula below into B2:
=IsItThere(A2)
You can then copy this formula down as many rows as needed.
Hope this helps.
Sean
===============
==========
Hi Rich,
You can do this with a user defined function ( a bit like a macro but can be used as any other function from Excel)
You need to go to VBE Alt+F11
Then paste in the following function into a module.
Function IsItThere(usname)
IsItThere = 0
flet = Left(usname, 1)
fnam = usname & ".ini"
sfol = "U:\Path_To_My_Files\" & flet
With Application.FileSearch
.NewSearch
.LookIn = sfol
.SearchSubFolders = False
.FileName = fnam
.MatchTextExactly = True
.FileType = msoFileTypeAllFiles
If .Execute() > 0 Then IsItThere = 1
End With
End Function
Next you need to change the Path to My Files to your own path and then you are ready to use the function in Excel.
Go back to Excel.
I am assuming your user names are in column A starting in row 2, and your test is in Col B.
Enter the formula below into B2:
=IsItThere(A2)
You can then copy this formula down as many rows as needed.
Hope this helps.
Sean
===============
Many thanks Sean. This has worked a treat. I had to create a small macro for it to refresh the info when more usernames are added, but it really is fantastic help.
Thanks
Rich