【逐行写入文本的代码】帮忙把写入改成输出
这个是在VBA里面用的,配合EXCEL的
i1 = 0 '重新归零
Open "E:\Code2\Line2\Com.txt" For Input As #12
Do While Not EOF(12)
Line Input #12, TextLine1
ReDim Preserve Alltext1(i1)
Alltext1(i1) = TextLine1
i1 = i1 + 1
Sheet3.Cells(i1, 1) = TextLine1 '把文本框的内容 逐行读取 写入到A列
Loop
Close #12
可是我不知道怎么输出
For Output ....Line Output?好像没这个语法
帮忙改改。。谢谢!
[解决办法]
dim i as long
for i=0 to uboumd(Alltext1)
print #12,Alltext1(i)
next
close #12
[解决办法]
Dim hFile As IntegerhFile = FreeFile() '<- 文件号要动态取得Open "E:\Code2\Line2\Com.txt" For Output As #hFileFor i1 = 0 To UBound(alltext1) Print #hFile, alltext1(i1)NextClose #hFile