PC Review


Reply
Thread Tools Rate Thread

Delete first line From CSV file from excel

 
 
JA
Guest
Posts: n/a
 
      17th Jul 2008

I am modifying a csv file from VBA and am adding a line to the beginning of
file which is working well. However, I'd like to delete teh first line of
the csv file before adding the line.

I have many files so it is not efficient to open them from excel. I'd like
to use the VBA Put, Print, Write statements etc.



 
Reply With Quote
 
 
 
 
Rick Rothstein \(MVP - VB\)
Guest
Posts: n/a
 
      17th Jul 2008
I presume you are using the code that RB Smissaert posted in response to
your "how do I add a line" request. If so, add this line immediately after
you load the file into the FileContents variable (that is, make the
following the next line after the **first** Close #hFile statement...

FileContents = Mid$(FileContents, InStr(FileContents, vbCrLf) + 2)

Rick


"JA" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
>
> I am modifying a csv file from VBA and am adding a line to the beginning
> of file which is working well. However, I'd like to delete teh first line
> of the csv file before adding the line.
>
> I have many files so it is not efficient to open them from excel. I'd
> like to use the VBA Put, Print, Write statements etc.
>
>
>


 
Reply With Quote
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
Challenge - Excel Line Feed Character CHR(10) - How to Delete and keep the text formatting without going ro single line in a cell ? Microsoft Excel Programming 6 7th Oct 2009 12:28 PM
Excel Line Feed Character - How to delete the CHR(10) and keep the formatting without going to single line.. Microsoft Excel Discussion 7 7th Oct 2009 11:13 AM
Challenge - Excel Line Feed Character CHR(10) - How to Delete and keep the text formatting without going ro single line in a cell ? Microsoft Excel Worksheet Functions 7 7th Oct 2009 11:10 AM
Re: Delete first line line(s) of text-file? Gary Keramidas Microsoft Excel Programming 0 26th Oct 2008 08:31 AM
Re: Delete first line line(s) of text-file? Gary Keramidas Microsoft Excel Programming 1 25th Oct 2008 04:03 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 10:34 PM.