• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 261
  • Last Modified:

Select dated workbook

Hi, i am looking to select a workbook that will be dated differently

I want the code to look for

"MI Ledger Report"

So it doesnt need to find a specific date, just the workbook that  begins with "MI Ledger Report"

Thanks
Seamus

0
Seamus2626
Asked:
Seamus2626
1 Solution
 
ragnarok89Commented:
try this:

Sub DoesWorkBookExist()
    
Dim i As Integer
With Application.FileSearch
    .LookIn = "C:\MyDocuments"
    '* represents wildcard characters
    .Filename = "MI Ledger Report*.xls"
    If .Execute > 0 Then 'Workbook exists
    For i = 1 To .FoundFiles.Count
        Workbooks.Open (.FoundFiles(i))
    Next i
    End If
End With

End Sub

Open in new window

0
 
Seamus2626Author Commented:
Thank you!
0

Featured Post

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now