Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Sub ColumnOut2Text()
- Dim i As Long
- Dim j As Long
- Dim Fno As Integer
- Dim OutColumn As String
- Const myPath As String = "C:\txt\"
- With Worksheets("Sheet1")
- For i = 2 To .Cells(Rows.Count, 1).End(xlUp).Row
- Fno = FreeFile()
- Open myPath & .Cells(i, 1).Value & ".txt" For Output As #Fno
- For j = 1 To .Cells(1, Columns.Count).End(xlToLeft).Column
- OutColumn = .Cells(1, j).Value & Chr(13) & .Cells(i, j).Value & Chr(13)
- Print #Fno, OutColumn
- Next j
- OutColumn = Empty
- Close #Fno
- Next i
- End With
- Beep
- End Sub
Add Comment
Please, Sign In to add comment