I'd like to output text file from some sample excel files.
So that I created following samples.
after opening text file , each rows are printed.
But when I try to loop over columns , these values are appended in one columns
Are there any good way to achieve row and column based loop ?
This text file uses comma separator.
Thanks.
Sub Test_Open()
Dim strFilePath As String
Dim ws As Worksheet
strFilePath = "C:\Users\test\text.txt"
Workbooks.Open "C:\Users\test.xlsx"
Set ws = ActiveWorkbook.Worksheets("test")
Open strFilePath For Output As #1
Dim row As Integer
Dim column As Integer
row = 7
Do Until ws.Cells(row, 2).Value = ""
For column = 1 To 86
Print #1, ws.Cells(row, column)
Next
row = row + 1
Loop
Close #1
End Sub