Hi,
needs less than 20 code lines with standard VBA functions !
Code to paste directly in the worksheet module :
Sub Demo()
With [A1].CurrentRegion
VN = .Columns(1).Value
VA = .Columns(2).Resize(, .Columns.Count - 1).Value
H$ = Join(Application.Index(VA, 1), vbTab) & vbNewLine
F% = FreeFile
For R& = 2 To .Rows.Count
Open ThisWorkbook.Path & "\" & VN(R, 1) & ".txt" For Output As #F
Print #F, H & Join(Application.Index(VA, R), vbTab)
Close #F
Next
Erase VA, VN
End With
End Sub
Enjoy it and don't forget to clik on bottom left star "Add Reputation", thanks !
Bookmarks