With Excel VBA you can both write (export) and import text files. This example shows how you can easily write a text file. The text uses semicolon as delimiter, so the file can be imported to cells in Excel (see: Import text files) or some other program.
Sub WriteTextFile()
Dim iFileNumber As Integer
Dim sFileText As String
Dim sFile As String
On Error GoTo ErrorHandle
sFileText = "This is a text;" & vbNewLine & _
"And this is the next line (or row) in the text.;1;2;3"
sFile = "filetest.txt"
ChDir "C:\"
iFileNumber = FreeFile
Open sFile For Output As #iFileNumber
Print #iFileNumber, sFileText
Close #iFileNumber
Exit Sub
ErrorHandle:
MsgBox Err.Description & ", procedure WriteTextFile"
End Sub