Clearing ".csv" file using VBA

December 12th, 2011 - 10:24 am ET by Mike | Report spam
Hi everyone,
Say I have this VBA piece:

Set BRngSolution Workbooks(filename).Worksheets("TimeMacTable").Range("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
email Follow the discussionReplies 5 repliesReplies Make a reply

Replies

#1 Don Guillett
December 12th, 2011 - 11:05 am ET | Report spam
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").Range("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

Similar topics