Sub test()
Dim txt As String
With Range("a1", Range("a" & Rows.Count).End(xlUp))
txt = Join(Evaluate("transpose(" & .address & ")"), vbCrLf)
End With
Open ThisWorkbook.Path & "\ColumnA.dat", For Append As #1
Print #1, txt
Close #1
End Sub
when I run your code I get the error "Compile Error: User-defined type not defined"
It then highlights:
Public Sub WriteRange(ByVal inputRange As Excel.Range, ByVal outputPath As String, _
Optional writeMode As eWriteMode =
Any ideas on how to improve your code?
Thank you all! Seiya's code worked like a charm! Thank you very much!Correction
delete comma on the line of
Rich (BB code):Open ThisWorkbook.Path & "\ColumnA.dat", For Append As #1
Might be the enum, they aren't supported in all versions. What version of Excel are you using?