I would like to load a folder's file names into an array. The number of files in the folder are variable. The folder pathname is S:\L01. The arrayname is "fileloader". Thanks in advance!
A starting point:
Dim strPathname As String
Dim fileloader()
Dim i As Long
Dim strFile As String
strPathname = "S:\L01"
strFile = Dir(strPathname & "\*.*")
While strFile <> ""
ReDim Preserve fileloader(i)
fileloader(i) = strFile
i = i + 1
strFile = Dir
Wend
MsBox (1 + UBound(fileloader)) & " files loaded in fileloader"
Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ181-2886
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.