Ask Your Question
0

How can Dir() in Excel VBA allow access to multiple types of files?

asked 2022-05-28 11:00:00 +0000

djk gravatar image

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
3

answered 2022-05-16 06:00:00 +0000

bukephalos gravatar image

Dir() can allow access to multiple types of files by using wildcards in the file extension parameter. For example, to search for all Excel files in a directory, you can use ".xlsx" as the file extension parameter. To search for both Excel and CSV files, you can use ".xlsx|.csv". The "|" character represents "or" in the file extension parameter, allowing Dir() to search for multiple types of files. Additionally, you can use the ".*" wildcard to search for all files in a directory.

edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account. This space is reserved only for answers. If you would like to engage in a discussion, please instead post a comment under the question or an answer that you would like to discuss

Add Answer


Question Tools

Stats

Asked: 2022-05-28 11:00:00 +0000

Seen: 12 times

Last updated: May 16 '22