Article ID: 141574
Article Last Modified on 10/11/2006
Sub loopyarray()
Dim filenames As Variant
' set the array to a variable and the True is for multi-select
filenames = Application.GetOpenFilename(, , , , True)
counter = 1
' ubound determines how many items in the array
While counter <= UBound(filenames)
'Opens the selected files
Workbooks.Open filenames(counter)
' displays file name in a message box
MsgBox filenames(counter)
'increment counter
counter = counter + 1
Wend
End Sub
Additional query words: 8.00 vbe xl97
Keywords: kbdtacode kbhowto kbprogramming KB141574