Thread: Flling an array
View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Ron de Bruin Ron de Bruin is offline
external usenet poster
 
Posts: 11,123
Default Flling an array

Hi Adri

Use Getopenfilename to do this

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



--
Regards Ron de Bruin
http://www.rondebruin.nl


"Adri" wrote in message ...
I need to fill an array with all (variabel) excel files in a specific
folder.
Example: Folder = d:\temp contains file1.xls, file2.xls etc
In stead of typing array("file1.xls", file2.xls", etc) the array must be
filled with the VBA code.
How can I do this.

Kind regards
Adri