View Single Post
  #4   Report Post  
Posted to microsoft.public.excel.misc
Mike Mike is offline
external usenet poster
 
Posts: 102
Default Clearing ".csv" file using VBA

On Dec 12, 11:05*am, Don Guillett wrote:
If you mean to clearcontents of the 1st page of the file then recorded/
edited
Sub Macro3()
* * Workbooks.Open Filename:="C:\yourfoledername\Book2.csv"
* * Cells.ClearContents
* * Activeworkbook.Close SaveChanges:=False
End Sub
Or do you want to KILL it.

On Dec 12, 9:24*am, Mike wrote:



Hi everyone,
Say I have this VBA piece:


Set BRngSolution =
Workbooks(filename).Worksheets("TimeMacTable").Ran ge("B6")
BRngSolution.Clear


but instead of a range in Excel sheet, I have thing in "abc.csv" that
I want to Clear. I tried this but didn't work:


Clear "C:\AM\Model\abc.csv"


how it should be written in VBA?


Thanks,
Mike- Hide quoted text -


- Show quoted text -


But if I have many ".csv" files, do I need to write this for every
file?