Consulting

Results 1 to 2 of 2

Thread: Select folder and insert folder path into cell

  1. #1

    Select folder and insert folder path into cell

    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?

  2. #2
    Moderator VBAX Guru Ken Puls's Avatar
    Joined
    Aug 2004
    Location
    Nanaimo, BC, Canada
    Posts
    4,001
    Location
    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.
    Ken Puls, CMA - Microsoft MVP (Excel)
    I hate it when my computer does what I tell it to, and not what I want it to.

    Learn how to use our KB tags! -||- Ken's Excel Website -||- Ken's Excel Forums -||- My Blog -||- Excel Training Calendar

    This is a shameless plug for my new book "RibbonX - Customizing the Office 2007 Ribbon". Find out more about it here!

    Help keep VBAX clean! Use the 'Thread Tools' menu to mark your own threads solved!





Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •