Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi
Im trying to append the info in an array which has numbers and letters. I cannot get the array to write to it. This does work because Ive tried the appending "hello World" to it. It also appends the "," Any help is appreciated Thanks And Thanks again for the many helps this group has provided to me Mike Dim myarray(19) as Variant Dim fs, f, ts, s, chk Set fs = CreateObject("Scripting.FileSystemObject") chk = fs.FileExists("c:\data.txt") If chk = True Then ' check if file exists Set f = fs.GetFile("c:\data.txt") Set ts = f.OpenAsTextStream(8, 0) ts.write "Hello World" For i = 1 To 19 ts.write myarray(i) & "," Next ts.write vbCrLf ts.Close Else 'if not create file fs.CreateTextFile "c:\data.txt" 'creates file Set f = fs.GetFile("c:\data.txt") Set ts = f.OpenAsTextStream(8, 0) ts.write "Hello World" For i = 1 To 19 ts.write myarray(i) & "," Next ts.write vbCrLf ts.Close End If |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Append text file | Excel Discussion (Misc queries) | |||
Append data from a column to separate table array | Excel Programming | |||
append file on e-mail | Excel Programming | |||
append file on e-mail | Excel Discussion (Misc queries) | |||
File Append Row by Cell value | Excel Programming |