Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Incorporate a folder picker in existing macro code

Posted on 2013-06-15
2
Medium Priority
?
321 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 27

Accepted Solution

by:
MacroShadow earned 2000 total points
ID: 39250649
Here you go.
EE.xlsm
0
 

Author Closing Comment

by:AndreasHermle
ID: 39252705
Hi Macro Shadow,

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

Featured Post

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction This Article briefly covers methods of calculating the NPV and IRR variants in Excel as well as the limitations in calculating and interpreting IRR results. Paraphrasing Richard Shockley, author of my favourite finance reference tex…
This article describes how to use a set of graphical playing cards to create a Draw Poker game in Excel or VB6.
The viewer will learn how to create two correlated normally distributed random variables in Excel, use a normal distribution to simulate the return on different levels of investment in each of the two funds over a period of ten years, and, create a …
This Micro Tutorial demonstrates using Microsoft Excel pivot tables, how to reverse engineer competitors' marketing strategies through backlinks.

618 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