Hi
Here's one quick way.
Sub aaa()
Set newbk = Workbooks.Add
ThisWorkbook.Activate
For Each ce In Range("A2:A" & Cells(Rows.Count, 1).End(xlUp).Row)
holder = "(" & ce.Value & "," & ce.Offset(0, 1).Value & "," & ce.Offset(0, 2).Value & "," & ce.Offset(0, 3).Value & ")[" & ce.Offset(0, 4).Value & "]"
newbk.Sheets(1).Cells(Rows.Count, 1).End(xlUp).Offset(1, 0).Value = holder
Next ce
On Error Resume Next
Kill "c:\temp\!aaa.txt" 'remove any existing file
On Error GoTo 0
newbk.SaveAs Filename:="C:\TEMP\!aaa.txt", FileFormat:=xlText
newbk.Close savechanges:=False
End Sub
rylo
Bookmarks