I have been using this code to choose multiple files to manipulate:
ArTemp = Application.GetOpenFilename(FileFilter:="All files (*.*), *.*", MultiSelect:=True)
'(where ArTemp is a variant)
For i = 1 To UBound(ArTemp)
myfile = ArTemp(i)
Workbooks.OpenText Filename:=myfile
' (do suff with this file)
Next i
Open file dialog opens, I shift-click to choose a list of files, macro runs it thing using those files. Strangely, however, the last file in the list is always processed first, follwed by the first, second, third, etc. I have been putting up with this for a very long time now, and looking around on the web, but it's about driving me crazy now! I have to admit, I don't know very much about vba stores to arrays. My collegue has a work around that stores the first record to a temp variable, then cycles thru the array, but I am interested in the WHY of it.
Bookmarks