返回列表 上一主題 發帖

Excel 輸出 txt,多餘空白行

回復 1# yenwang


    Sub test()


Dim fso As Object, filledCellsCount As Integer
Set fso = CreateObject("Scripting.FileSystemObject")
Set target = fso.CreateTextFile("d:\javainput.txt", True)

filledCellsCount = 8

For i = 1 To filledCellsCount - 1
   target.WriteLine Cells(i, 1)
Next
target.Write Cells(filledCellsCount, 1)
target.Close
Set fso = Nothing

End Sub

TOP

        靜思自在 : 每天無所事事,是人生的消費者,積極、有用才是人生的創造者。
返回列表 上一主題