VisualBasic/Excel "GetOpenFileName"

C

carl

hi. could someone show me how the code looks to use this
function to open up these 2 files:

c/:File1.xls
c/:File2.xls

thank you
 
R

Ron de Bruin

Sub testing()
Dim FName As Variant
Dim N As Long
FName = Application.GetOpenFilename(filefilter:="Excel Files (*.xls), *.xls", _
MultiSelect:=True)

If IsArray(FName) Then
For N = LBound(FName) To UBound(FName)
Workbooks.Open (FName(N))
Next
End If
End Sub

Browse to the folder where the files are and select both
Click on open
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top