Delete first line From CSV file from excel

  • Thread starter Thread starter JA
  • Start date Start date
J

JA

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.
 
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
 
Back
Top