Delete a line of text file

F

Francis Ang

I have created a text file using the Open Statement. How do I delete a specific line say line 3 using VBA codes? Any help is very much appreciated. Thank you.
 
T

Tom Ogilvy

workbooks.open "C:\My Files\Myfile.txt"
Rows(4).EntireRow.Delete
workbooks.Close SaveChanges:=True

--
Regards,
Tom Ogilvy
Francis Ang said:
I have created a text file using the Open Statement. How do I delete a
specific line say line 3 using VBA codes? Any help is very much
appreciated. Thank you.
 
Top