Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default 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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Userform close button AOU Excel Discussion (Misc queries) 4 September 21st 07 05:56 PM
Pls add browse button for Hyperlink function Katharine Hu Excel Worksheet Functions 0 July 17th 06 07:13 AM
Browse button on form for folder path Greshter Excel Discussion (Misc queries) 2 January 12th 06 10:20 PM
Use the X button on a userform Greg B Excel Discussion (Misc queries) 3 May 16th 05 09:19 AM
Close Button on Userform Jean-Paul Viel Excel Programming 0 September 20th 03 06:44 PM


All times are GMT +1. The time now is 09:41 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"