Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Sub MorshedDhaka()
- Dim Fldr As String, Fname As String
- Dim ObjFldr As Object
- Dim i As Long
- Set ObjFldr = Application.FileDialog(4)
- With ObjFldr
- .Title = "Choose a folder"
- .AllowMultiSelect = False
- If .Show = -1 Then Fldr = .SelectedItems(1)
- End With
- If Fldr = "" Then Exit Sub
- Fname = Dir(Fldr & "\*")
- Do While Fname <> ""
- i = i + 1
- Cells(i, 1) = Left(Fname, InStrRev(Fname, ".") - 1)
- Cells(i, 2) = Fldr & "\" & Fname
- Fname = Dir()
- Loop
- End Sub
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement