Private Sub CommandButton2_Click ()
Dim myFso
Dim myTxt
Dim BRR (), Arr, Tim, dah, I, ZDH, dh
Dh=Range (" c400000 "). The End (xlUp). Row
If dh & lt; 3 Then MsgBox "run-time error:" & amp; CRH (13) & amp; "No data in the table!" : End
Tim=Timer
ZDH=Range (" c400000 "). The End (xlUp). Row
The Set myFso=CreateObject (" Scripting. FileSystemObject ")
The Set myTxt=myFso. CreateTextFile (Filename:=ThisWorkbook Path & amp; "\ operation result. TXT", OverWrite:=True)
With myTxt
Dah=Range (" c400000 "). The End (xlUp). Row
Arr=Range (b1: "g" & amp; Dah)
ReDim BRR (1 To dah)
For I=3 To UBound (Arr)
BRR (I)=Arr (I, 1) & amp; ", "& amp; Arr (I, 2) & amp; ", "& amp; Arr (I, 3) & amp; ", "& amp; Arr (I, 4) & amp; ", "& amp; Arr (I, 5)
Next
For I=1 To dah
. WriteBlankLines 1
The.write BRR (I)
Next
. Close
End With
(q1)="timing" & amp; Format (Timer - Tim, "0.00") & amp; "Seconds"
MsgBox "at the end of operation & amp;" CRH (13) & amp; "" operation results" save E: \ test!"
The Set myTxt=Nothing
The Set myFso=Nothing
End Sub
Question:
1/no change For I=3 this code, because before the EXCEL table 2 rows with data, how to make export line TXT without 3 Spaces? The novice To learn ING