How do I export a specific excel sheet (say sheet1) as a text file? I would like to do this with macro code.
Grateful for ideas on this.
This code will do it:
Sheet1.SaveAs "C:\output path\output file.txt", <format>
The <format> parameter is of type XlFileFormat; for a CSV text file, use xlCSV or xlCSVMSDOS. The VBA documentation enumerates all the possible format options.
Thanks a lot, it works like a sharm!
Microsoft is conducting an online survey to understand your opinion of the Msdn Web site. If you choose to participate, the online survey will be presented to you when you leave the Msdn Web site.
Would you like to participate?