VBA Dialogue FileFilter Partial File Name

前端 未结 3 1309
北荒
北荒 2021-01-19 04:53

I have a directory with several .txt files. Let\'s say

hi.txt
hello.txt
hello_test.txt
test.txt

Using a file dialogue in VBA, how can I fil

3条回答
  •  -上瘾入骨i
    2021-01-19 05:40

    How about filedialog?

    Dim dlgOpen As FileDialog
    Set dlgOpen = Application.FileDialog(msoFileDialogOpen)
    With dlgOpen
        .AllowMultiSelect = True
        .InitialFileName = "Z:\docs\*t*.*x*"
        .Show
    End With
    

    http://msdn.microsoft.com/en-us/library/aa213120(v=office.11).aspx

提交回复
热议问题