View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Rick Rothstein \(MVP - VB\)[_2335_] Rick Rothstein \(MVP - VB\)[_2335_] is offline
external usenet poster
 
Posts: 1
Default Delete first line From CSV file from excel

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

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.