S
Sarah
In a folder, there are several files with similar names and I need to open
the most recently created file. No, I don't want anything from the "Recently
Used" collection. Now, I have an input box to receive the date in the right
format, but it would be more efficient to just have VB go open the right one.
Here's what I have now: ChDir "D:\Users\Me\My Documents\MMM\METRICS_DATA"
s = InputBox("What is the date on the METRICS/OPERATIONAL_DATA file?
Please use this format: 2008_09")
If Application.Workbooks("D:\Users\Me\My
Documents\MMM\METRICS_DATA\OPERATIONAL_DATA_" & s & ".xls") = True Then
Application.Workbooks.Open _
("D:\Users\Me\My Documents\MMM\METRICS_DATA\OPERATIONAL_DATA_" &
s & ".xls")
End If
If "D:\Users\Me\My Documents\MMM\METRICS_DATA_" & s & ".xls" = True Then
Workbooks.Open Filename:= _
"D:\Users\Me\My Documents\MMM\METRICS_DATA_" & s & ".xls"
End If
the most recently created file. No, I don't want anything from the "Recently
Used" collection. Now, I have an input box to receive the date in the right
format, but it would be more efficient to just have VB go open the right one.
Here's what I have now: ChDir "D:\Users\Me\My Documents\MMM\METRICS_DATA"
s = InputBox("What is the date on the METRICS/OPERATIONAL_DATA file?
Please use this format: 2008_09")
If Application.Workbooks("D:\Users\Me\My
Documents\MMM\METRICS_DATA\OPERATIONAL_DATA_" & s & ".xls") = True Then
Application.Workbooks.Open _
("D:\Users\Me\My Documents\MMM\METRICS_DATA\OPERATIONAL_DATA_" &
s & ".xls")
End If
If "D:\Users\Me\My Documents\MMM\METRICS_DATA_" & s & ".xls" = True Then
Workbooks.Open Filename:= _
"D:\Users\Me\My Documents\MMM\METRICS_DATA_" & s & ".xls"
End If