...

View Full Version : How to add "Filter" and Delete columns and rows in CSV/XLS via VBScrip



Leos
04-13-2012, 02:17 PM
Hello.

Could you help me.

I have some report and I need to Open csv/xls and than:

1. delete first row
2. delete some columns
3. add 3 kolumn names

Could you help me ? (it needs to be a function)

I now hot to do it in VBA but I don;t have idea how to to it in VBS

I Have some code:




Function OK()

Const ForReading = 1
Const ForWriting = 2

Set objFSO = CreateObject("Scripting.FileSystemObject")
Set objFile = objFSO.OpenTextFile("c:\CSVFiles\Rapport.csv", ForReading)

(...)

objFile.Close

Set objFile = objFSO.OpenTextFile("c:\CSVFiles\Text.csv", ForWriting)

objFile.Write strNewContents
objFile.Close

End Function



Could you help me ?



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum