ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   Browse button on form for folder path (https://www.excelbanter.com/excel-discussion-misc-queries/64662-browse-button-form-folder-path.html)

Greshter

Browse button on form for folder path
 
Hi All

I am trying to create a form which has a button which can browse for a
folder path. I then need to have this path placed in an adjacent
textbox. I think I need something along the lines of the following in
the command button's code:

Application.GetOpenFilename

however this piece of code just opens a file whereas I need the
pathname for a folder.

Any ideas out there would be greatly appreciated.

Cheers,
Mike


Dave Peterson

Browse button on form for folder path
 
Jim Rech has a BrowseForFolder routine at:
http://www.oaltd.co.uk/MVP/Default.htm
(look for BrowseForFolder)

John Walkenbach has one at:
http://j-walk.com/ss/excel/tips/tip29.htm

If you and all your users are running xl2002+, take a look at VBA's help for:
application.filedialog(msoFileDialogFolderPicker)

Greshter wrote:

Hi All

I am trying to create a form which has a button which can browse for a
folder path. I then need to have this path placed in an adjacent
textbox. I think I need something along the lines of the following in
the command button's code:

Application.GetOpenFilename

however this piece of code just opens a file whereas I need the
pathname for a folder.

Any ideas out there would be greatly appreciated.

Cheers,
Mike


--

Dave Peterson

Greshter

Browse button on form for folder path
 
Those were two excellent links and just what I was after.

Thanks for that Dave



All times are GMT +1. The time now is 07:18 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com