I have a section of code which opens each text file in a folder and I want to not only put the file name into an array but also split the text inside the file into an array, something like this:
i = 0
n = 1
For Each File In Folder
i = i + 1
Dim UserArray & i()
Set openedFile = fso.OpenTextFile(File)
Do Until openedFile.AtEndOfStream
Line = openedFile.ReadLine
ReDim Preserve UserArray & i(n)
UserArray & i(n) = Line
n = n + 1
Loop
n = 0
Loop
The idea being that each line will later be strComp to another array of lines from a different text file. So each file needs to create a unique array name for its text contents and the number of files in any given folder varies.
The above does not work,any ideas?