给你举个例子:Sub test11()
Open ThisWorkbook.Path & "\output.txt" For Output As #1
'在#1打开当前文件夹中的output.txt文件
str1 = "123"
str2 = "你好吗"
str3 = "hello"
Print #1, str1, str2, str3, Date
'写入内容
Write #1, str1, str2, str3, Date
'写入内容
Close #1
'关闭#1这个文件End Sub程序会在output.txt文件内生成两列内容如下:123
你好吗
...
|