VBA for Exporting to Text file

  • Thread starter Thread starter santaviga
  • Start date Start date
S

santaviga

I have input the following code and it works to an extent, when it runs
the macro to export the data to text file, the text is all joined and not in
columns, is there anywhere I need to put in so if there is only 5 characters
it will pad the text out to 12 and therefore keep the text file as if it were
in columns?

Many thanks
 
I use this simple macro:
Sub SaveAsText()
ThisWorkbook.SaveAs Filename:="MyText.txt", _
FileFormat:=xlTextWindows
End Sub


Regards,
Ryan--
 
Hi Ryan, That code you gave me not doing anything I need, its creating the
text file but nothing in it and clearing data in wxcel.
 
Hummm, not sure why it is behaving like this; it works fine for me. Did you
check 'My Documents' for the file? I just tested it again; works fine here.

Ryan--
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Back
Top