VisualBasic/Excel "GetOpenFileName"

  • Thread starter Thread starter carl
  • Start date Start date
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
 
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
 
Back
Top