PDA

View Full Version : Select folder and insert folder path into cell



Johnsonste
09-04-2009, 02:58 PM
Hi,

I have found some code that will allow me to select a file from the standard pop-up window and then insert the file name into a cell that I specify. How can I do this with a folder? I want to have the user click on a button that launches a macro that opens the standard "open file" window and allows the user to select a folder and hit open. After hitting open, the name and path of the folder should be inserted into a specific cell. This is only one folder - not a batch listing. Any ideas?

Ken Puls
09-04-2009, 03:42 PM
Have a look at this KB entry to get you started: http://www.vbaexpress.com/kb/getarticle.php?kb_id=284

Your macro would essentially need to call the BrowseForFolder function, then place the returned value in the cell.

I'm not sure what your level is with VBA here, so let us know if this isn't enough.