Code
Sub Button1_Click()
Config = vbYesNo + vbQuestion + vbDefaultButton2
Ans = MsgBox("Crank it?", Config)
If Ans = vbYes Then
Workbooks.Open "C:\boombox\" & Format(Date, "dd.mm.YYYY") & ".xlsx"
ElseIf Ans = vbNo Then
End If
End Sub
Hi,
I was wondering about a way to modify this code to either
1) Find out if the workbook exists, and if it doesn't, return an error
OR EVEN BETTER
2) If it doesn't, go back in time day by day until a workbook DOES exist.
i.e. Workbooks.Open "C:\boombox\" & Format(Date, "-1dd.mm.YYYY") & ".xlsx"
or
Workbooks.Open "C:\boombox\" & Format(Date, "-2dd.mm.YYYY") & ".xlsx"
THANK YOU