Okay, the loop worked, but the example above opened both today's date, and the previous date. I modified it as follows.
Sub OpenFile()
Dim i As Integer
Dim strFileName As String
On Error Resume Next
i = 0
Do
Err.Clear
strFileName = "File " &...
Bongs code works great. Now how about on a monday or after a holiday? On another project, I just made a input box pop up asking for the previous day's date, stored that as a string, and used it when the previous day's date was needed. That seems the simplest right now, but if I can find a more...
I have a file name saved by date, and I'd like to make a conditional formula to check to see if there's a file name with the current date in it, and if not, open the previous day's file. This code will open the two files.
Sub OpenFile()
Dim strYesterdayFile As String
Dim strTodayFile As String...
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.