Here is one way.
Code:
Function CountLines(strFilename as string) as long
dim FF as long
Dim strTest as String
FF = freefile
CountLines = 0
open strFilename for input as #FF
do until EOF(FF)
line input #FF, strTest
CountLines = CountLines +1
Loop
close #ff
To call:
Code:
AmountOfLines=CountLines("C:\myfile.txt")
|
__________________
. <--- Photo of me viewed from the Hubble telescope
|