You can read the whole file but only remember the last line so you're not
using up lots of memory.
This only remembers the last record read...
Do While Not EOF(iFileNum)
Input #iFileNum, strEachRecord
strLastLine = strEachRecord
Loop
--
Hope this helps.
If it does, please click the Yes button.
Thanks in advance for your feedback.
Gary Brown
"Jennifer" wrote:
> Hello,
>
> Is there a method that I can overwrite the last line of csv/text file
> WITHOUT reading the whole file from the first line from Excel VBA ?
>
> I am trying to read the last line of data and use if function to determine
> if it would be overwritten. Besides reading the whole file in and rewriting
> all of them out, is there another efficient way to handle it?
>
|