I have a 2 gig csv file that I want to read into an excel vba macro process one record at a time, or one datum at a time. How can I? Can I?
Asked
Active
Viewed 82 times
1 Answers
1
You can use the Scripting.FileSystemObject
to do that:
As a sample of how you can read in a file line by line:
Set objFSO = CreateObject("Scripting.FileSystemObject")
Set objFile = objFSO.OpenTextFile("C:\FSO\ServerList.txt", 1)
Do Until objFile.AtEndOfStream
strLine = objFile.ReadLine
... You code here ...
Loop
objFile.Close
Just remember to add a reference to the Microsoft Scripting Runtime
(where the FileSystemObject is)

Community
- 1
- 1

John Bustos
- 19,036
- 17
- 89
- 151