Created
March 5, 2018 03:02
-
-
Save DuongAQ/f69bad78a84f805f4c6c1c60bb7cfcc3 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sub GetDirNames() 'Lấy danh sách tên file trong thư mục | |
Const sPath="C:\Test\" 'Đường dẫn tới thư mục | |
Dim sFil As String | |
sFil=Dir(sPath & "*.xl*") 'đuôi file .xlsx .xlsb .xlsm... đều sử dụng được | |
Do While sFil <> "" | |
Range("D65536").End(xlUp)(2).Value=sPath & sFil 'Lấy danh sách các tên file trong thư mục | |
sFil=Dir | |
Loop | |
End Sub |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment