Question: how to import file names into excel vba?
Answer: Launch a new worksheet that you want to import the file names.
Hold down the ALT + F11 keys to open the Microsoft Visual Basic for Applications window.
Click Insert > Module, and paste the following code in the Module Window.