Thread: User Forms
View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.programming
Tom Ogilvy Tom Ogilvy is offline
external usenet poster
 
Posts: 27,285
Default User Forms

If you want to select files, you would not use a userform

You would use

Dim bk1 as Workbook, bk2 as Workbook
Dim fName as String
fName = Application.GetOpenFilename()
if fName < "False" then
set bk1 = workbooks.Open( fName)
Else
msgBox "You hit cancel, the procedure will be exited"
end if
fName = Application.GetOpenFilename()
if fName < "False" then
set bk2 = workbooks.Open( fName)
Else
msgBox "You hit cancel, the procedure will be exited"
end if

See the options for GetOpenFileName in Excel VBA help for arguments you
might want to use with GetOpenFileName

to set the starting directory before displaying the dialog, then before the
first fName = line put in code like the below:

ChDrive "C"
ChDir "C:\MyFolder"

--
Regards,
Tom Ogilvy




"ajocius" wrote in
message ...

Group,
Can someone recommend a site or give me a link to a beginners
description to User Forms in VBA. As my application begins to get very
mature with the assistance of many fine VBA programmers in this forum,
I'm now entering the visual aspect of the project. I want the operator
to have a nice and visually attractive spot to start from. I'd like to
have a button that starts the Super Macro and possibly allow the
operator to select the old file and new file from the same form. All
of which requires multiple lines of code I'm sure. Your suggestions
much apppreciated. Thank you in advance.

Tony


--
ajocius
------------------------------------------------------------------------
ajocius's Profile:

http://www.excelforum.com/member.php...o&userid=17695
View this thread: http://www.excelforum.com/showthread...hreadid=486703