On Oct 22, 12:35*pm, "Ammy" <vbsstr...@xxxxxx> wrote:
> Can anybody help me withe this script.
> I want comma seperated files (; ) import it to excel.
> The script is ok but the data could not split in the rows, i must change
> that in excel.
> Like Extra >>Text to coloms.
> Here is the script :
Since your file is NOT comma delimited, their are only two things I
can think to do; change the delimiter in the file to commas or use an
Excel data import in place of the open. Here is a macro I recorded in
Excel, with the extra bits stripped out and some other changes to make
it VBS compatible. Its up to you to install in in your script ...
' Macro2 Macro
' Macro recorded 10/22/2008 by Tom Lavedas
sFileSpec = "C:\Someplaceuseful\test.csv"
With ActiveSheet.QueryTables.Add("TEXT;" & sFileSpec, Range("A1"))
.AdjustColumnWidth = True
.TextFileStartRow = 1
.TextFileParseType = 1 ' xlDelimited
.TextFileSemicolonDelimiter = True