LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #6   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 1,231
Default Clearing ".csv" file using VBA

On Dec 12, 7:24*am, Mike wrote...
....
Set BRngSolution =
Workbooks(filename).Worksheets("TimeMacTable").Ra nge("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"

....

You want to clear only the value in the 6th line, 2nd field in the CSV
file?

Sub foo()
Dim f As Workbook

Application.DisplayAlerts = False
Set f = Workbooks.Open(Filename:="C:\AM\Model\abc.csv", Format:=2)
f.Worksheets(1).Range("B6").ClearContents
f.Close SaveChanges:=True

End Sub
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
Selecting "Save As" adds "Copy of" to file name- MS Excel 2007 ronhansen Excel Discussion (Misc queries) 1 November 15th 09 09:33 PM
Converting "uppercase" string data to "lower case" in CSV file [email protected] Excel Discussion (Misc queries) 2 August 12th 08 08:36 PM
text string: "91E10" in csv file auto converts to: "9.10E+11" [email protected] Excel Discussion (Misc queries) 2 August 12th 08 03:13 PM
Excel - Golf - how to display "-2" as "2 Under" or "4"as "+4" or "4 Over" in a calculation cell Steve Kay Excel Discussion (Misc queries) 2 August 8th 08 01:54 AM
Lost "File Menu" - now it's "Edit / View / Insert.." but no "F daves Excel Discussion (Misc queries) 3 April 24th 07 04:52 AM


All times are GMT +1. The time now is 09:35 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"