Home |
Search |
Today's Posts |
#1
|
|||
|
|||
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. |
#2
|
|||
|
|||
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. |
#3
|
|||
|
|||
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. |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Automatic Populate Todays Date in Cell when File is Saved. | Excel Discussion (Misc queries) | |||
Excel file modification date | Excel Discussion (Misc queries) | |||
Formula to determine a future date based on criteria | Excel Worksheet Functions | |||
Using formulas to determine date in one cell based on date in anot | Excel Worksheet Functions | |||
Show a date based on today | Excel Worksheet Functions |