Delete a line in text file

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have created a text file using the Open Statement. How do I delete a specific line say line 4 of the text file using VBA. Any help is very much appreciated. TIA
 
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 4 of the text file using VBA. Any help is very much
appreciated. TIA
 
Thanks Tom.

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

--
Regards,
Tom Ogilvy


specific line say line 4 of the text file using VBA. Any help is very much
appreciated. TIA
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top