ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   If the file exists "Yes should appear" (https://www.excelbanter.com/excel-programming/356861-if-file-exists-yes-should-appear.html)

Sami82[_27_]

If the file exists "Yes should appear"
 

Hi All,

I am asking people to fill out a questionairre, which their responses
are saved in a shared folder. Their responses are saved as
theirname.xls. Is it possible, if I have an excel sheet with all the
names in one column, to have excel put a "YES" in the adjacent column
if the userse file exists?

Thank you for your quick reply.


--
Sami82
------------------------------------------------------------------------
Sami82's Profile: http://www.excelforum.com/member.php...o&userid=27111
View this thread: http://www.excelforum.com/showthread...hreadid=525538


Tim Williams

If the file exists "Yes should appear"
 
Function FileExists(UserName as string) as string
Const DIRPATH as string="C:\stuff\" 'or whatever

if dir(DIRPATH & UserName & ".xls")<"" then
FileExists="Yes"
else
FileExists="No"
end if

end function



Tim

"Sami82" wrote in
message ...

Hi All,

I am asking people to fill out a questionairre, which their responses
are saved in a shared folder. Their responses are saved as
theirname.xls. Is it possible, if I have an excel sheet with all the
names in one column, to have excel put a "YES" in the adjacent column
if the userse file exists?

Thank you for your quick reply.


--
Sami82
------------------------------------------------------------------------
Sami82's Profile:
http://www.excelforum.com/member.php...o&userid=27111
View this thread: http://www.excelforum.com/showthread...hreadid=525538





All times are GMT +1. The time now is 11:49 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com