' ================================================== ' This is a very quick mod of some code I have to you ' what you want. remove unused vars and such. ' set ref to microsoft scripting runtime Public Function CountLines(strSourceFile As String) As Long Dim fso As New FileSystemObject, txtfile, filSource As File, strAll As String, _ filTarget As File, ts As TextStream, strRec As String Dim aCoords As Variant ' holds the coordinates CountLines = 0 Set filSource = fso.GetFile(strSourceFile) ' assign file Set ts = filSource.OpenAsTextStream(ForReading) ' Read the contents of the file. While Not ts.AtEndOfStream ' Start loop CountLines = CountLines + 1 Wend ts.Close ' Cleanup End Function
"If ye love wealth better than liberty, the tranquility of servitude better than the animated contest of freedom, go home from us in peace. We ask not your counsel or arms. Crouch down and lick the hands which feed you. May your chains set lightly upon you, and may posterity forget that ye were our countrymen."
~Samuel Adams