关于看到一个类似文件,但不是我要的类型,想自己做个,但不知道怎么做?请教高手
我要的是导出后 1| 00008888|张三|888.00|这个样子的。的问题
Sub 按钮1_单击()
Dim i As Integer: Dim arr(0 To 3)
Open ThisWorkbook.Path & “\abc.txt” For Output As #1
Print #1, “序号|卡号|姓名|金额|”
Close #1
Open ThisWorkbook.Path & “\abc.txt” For Append As #1
For i = 2 To [a65536].End(xlUp).Row
For k = 0 To 3
arr(k) = Cells(i, k + 1)
Next k
mystr = Join(arr, “|”) & “|”
Print #1, mystr
Next i
Close #1
End Sub