Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Delete a line in text file

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
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Delete a line in text file

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

--
Regards,
Tom Ogilvy

"Francis Ang" <Francis wrote in message
...
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


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 75
Default Delete a line in text file

Thanks Tom.

"Tom Ogilvy" wrote:

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

--
Regards,
Tom Ogilvy

"Francis Ang" <Francis wrote in message
...
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



Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
output to the same line in a Text file? Bernard Excel Discussion (Misc queries) 2 November 25th 09 08:12 PM
Challenge - Excel Line Feed Character CHR(10) - How to Delete and keep the text formatting without going ro single line in a cell ? No Name Excel Worksheet Functions 7 October 7th 09 11:10 AM
How do I delete a few words from a line of text? lauras03 Excel Worksheet Functions 3 February 16th 07 06:20 PM
End of file marker from Text File - Delete? 43fan Excel Programming 0 April 29th 04 06:06 PM


All times are GMT +1. The time now is 07:59 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"