Solved

Incorporate a folder picker in existing macro code

Posted on 2013-06-15
2
308 Views
Last Modified: 2013-06-17
Dear Experts:

below macro, courtesy of an EE expert, lists all the paths of all files of a given directory in Column A of the current worksheet.

I  wonder whether somebody could help me to incorporate a folder picker in this code.

Help is much appreciated. Thank you very much in advance.

Regards, Andreas


Sub List_Path_Of_Files()
'List Files (entire path) from a given directory in Column A of current excel worksheet
'requires a folder picker to be perfect

Dim MyFolder As String
Dim MyFile As String
Dim a As Integer
MyFolder = "C:\Test\" ' <-- Change to your folder
MyFile = Dir(MyFolder & "*.*")
a = 0
Do While MyFile <> ""
    a = a + 1
    Cells(a, 1).Value = MyFolder & MyFile
    MyFile = Dir
Loop
MsgBox "Done. Column A lists all of the files of the given directory"
End Sub

Open in new window

0
Comment
Question by:AndreasHermle
2 Comments
 
LVL 26

Accepted Solution

by:
MacroShadow earned 500 total points
Comment Utility
Here you go.
EE.xlsm
0
 

Author Closing Comment

by:AndreasHermle
Comment Utility
Hi Macro Shadow,

I am very impressed. Thank you very much for your swift and professional help. Regards, Andreas
0

Featured Post

What Should I Do With This Threat Intelligence?

Are you wondering if you actually need threat intelligence? The answer is yes. We explain the basics for creating useful threat intelligence.

Join & Write a Comment

Introduction This Article is a follow-up to my Mappit! Addin Article (http://www.experts-exchange.com/A_2613.html), it was inspired by an email posting I made to EUSPRIG (http://www.eusprig.org/index.htm), I will briefly cover: 1) An overvie…
This code takes an Excel list of URL’s and adds a header titled “URL List”. It then searches through all URL’s in column “A”, looking for duplicates. When a duplicate is found, it is moved to the top of the list. The duplicate URL’s are then highlig…
The viewer will learn how to simulate a series of sales calls dependent on a single skill level and learn how to simulate a series of sales calls dependent on two skill levels. Simulating Independent Sales Calls: Enter .75 into cell C2 – “skill leve…
This Micro Tutorial will demonstrate the scrolling table in Microsoft Excel using the INDEX function.

772 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now