Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi,
I would like to run a macro which will work like this: MsgBox "Select file 1" - Import data dialog box to allow user to select an excel file MsgBox "Select file 2" - Import data dialog box to allow user to select an excel file I dont want to define the path or filename, but want the user to be able to select the file to import. Thank you ahead of time for your help!!!! Dan |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I always use code lke this to have the user select a file (without actually
opening the file yet). Dim Fyle1 As String 'The user needs to select the file from which data should be retrieved. 'GetOpenFilename displays a standard File Open dialog, but it only gets 'the file name - it doesn't open the file. Fyle1$ = Application.GetOpenFilename("Excel Files (*.xls), *.xls") 'If no file was selected (Cancel clicked), stop the macro. If Fyle1$ = "False" Then Exit Sub 'Open the selected workbook. Workbooks.Open Filename:=Fyle1$ Hope this helps, Hutch "dan" wrote: Hi, I would like to run a macro which will work like this: MsgBox "Select file 1" - Import data dialog box to allow user to select an excel file MsgBox "Select file 2" - Import data dialog box to allow user to select an excel file I dont want to define the path or filename, but want the user to be able to select the file to import. Thank you ahead of time for your help!!!! Dan |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Import worksheets from another workbook? | Excel Worksheet Functions | |||
import data between worksheets | Excel Discussion (Misc queries) | |||
How do I import and filter worksheets into a template? | Excel Discussion (Misc queries) | |||
Import/Copy some data from one workbook to a similar workbook | Excel Programming | |||
Import various Worksheets | Excel Worksheet Functions |