LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 340
Default VBA user form

Robert, you could assoiciate the following code with the button (refer to
the macro name in the button's click event):

Sub Select_A_File()
Dim sFile, I As Integer
'display dialog asking user to select a file
sFile = Application.GetOpenFilename _
("Files (*.xls),*.xls", , "Select A File")

'check to see if cancel selected in the box
If sFile = "False" Then

MsgBox "No file selected. Activity halted."
End
End If
End Sub

Bob Flanagan
Macro Systems
http://www.add-ins.com
Productivity add-ins and downloadable books on VB macros for Excel


"robert_woodie " wrote in
message ...
I have a user form which simpily inputs a couple of strings as
variables. However i would like to enter a filepath, is it possible to
have a but which allows the user to select a file and have that file
path put in the text box?

Cheers
Robert


---
Message posted from http://www.ExcelForum.com/



 
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
How do I fill a cell in a user form from a selection on same form? Terry Tipsy Excel Discussion (Misc queries) 4 June 11th 07 02:59 PM
User Form Obi-Wan Kenobi Excel Discussion (Misc queries) 1 March 23rd 06 07:21 PM
User form Mike Rogers Excel Discussion (Misc queries) 2 March 10th 06 05:56 PM
user form Bill[_19_] Excel Programming 0 October 23rd 03 04:32 AM
I am looking to see if anybody has an equivalant user form to Outlooks CONTACT form BruceJ[_2_] Excel Programming 2 October 15th 03 05:28 PM


All times are GMT +1. The time now is 11:35 PM.

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

About Us

"It's about Microsoft Excel"