ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   VBA to call file based on date (https://www.excelbanter.com/excel-discussion-misc-queries/23317-vba-call-file-based-date.html)

fLiPMoD£

VBA to call file based on date
 
Hello,

I wonder if anyone can help me with a VBA routine to check for the presence
of a specific file.
The file is saved on a dialy basis in the format "userfile_run_YYYYMMDD.xls"

i am seeking help with a vb code that will check if today or any specified
days report is generated. i guess excel can use the date format to read the
specified location for the file.

Thank you in advance for your help.


.....Coming from Where I'm from.



Bob Phillips

Dim sFile As String

sFile = Dir("C:myPath\userfile_run_" & Format(Date,"yyyymmdd") & ".xls")
If sFile < "" Then
Msgbx "File Exists
End If

--

HTH

RP
(remove nothere from the email address if mailing direct)


"fLiPMoD£" wrote in message
...
Hello,

I wonder if anyone can help me with a VBA routine to check for the

presence
of a specific file.
The file is saved on a dialy basis in the format

"userfile_run_YYYYMMDD.xls"

i am seeking help with a vb code that will check if today or any

specified
days report is generated. i guess excel can use the date format to read

the
specified location for the file.

Thank you in advance for your help.


....Coming from Where I'm from.





fLiPMoD£

Perfect...you are a star.

Thanks.

"Bob Phillips" wrote in message
...
Dim sFile As String

sFile = Dir("C:myPath\userfile_run_" & Format(Date,"yyyymmdd") &

".xls")
If sFile < "" Then
Msgbx "File Exists
End If

--

HTH

RP
(remove nothere from the email address if mailing direct)


"fLiPMoD£" wrote in message
...
Hello,

I wonder if anyone can help me with a VBA routine to check for the

presence
of a specific file.
The file is saved on a dialy basis in the format

"userfile_run_YYYYMMDD.xls"

i am seeking help with a vb code that will check if today or any

specified
days report is generated. i guess excel can use the date format to read

the
specified location for the file.

Thank you in advance for your help.


....Coming from Where I'm from.








All times are GMT +1. The time now is 01:48 AM.

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