Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Adding browse button to userform
Hi all,
I'm trying to add a browse button to a custom userform. The goal is to capture the path and filename the user selects, display it in the text box, and set it equal to a variable. I know it has to use a file system object, but I don't know where to go from there. Any help/code would be appreciated. -Brad |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Adding browse button to userform
Private Sub CommandButton1_Click()
Dim fName as String fName = Application.GetOpenFileName() if not fName = "False" then Textbox1.Value = fName End if end Sub See Excel VBA help on Application.GetOpenFilename for options such as filetype. Use Chdrive and Chdir to start at a specific location. -- Regards, Tom Ogilvy "Brad" wrote in message ... Hi all, I'm trying to add a browse button to a custom userform. The goal is to capture the path and filename the user selects, display it in the text box, and set it equal to a variable. I know it has to use a file system object, but I don't know where to go from there. Any help/code would be appreciated. -Brad |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Userform close button | Excel Discussion (Misc queries) | |||
Pls add browse button for Hyperlink function | Excel Worksheet Functions | |||
Browse button on form for folder path | Excel Discussion (Misc queries) | |||
Use the X button on a userform | Excel Discussion (Misc queries) | |||
Close Button on Userform | Excel Programming |