View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Mike Fogleman Mike Fogleman is offline
external usenet poster
 
Posts: 1,092
Default [Macro excel] How to create and export a sheet into a *.inp (or *.txt) file

Something like this:

Sub NewTextFile()
Sheets("Sheet1").Copy
ChDir "C:\" 'your folder path
ActiveWorkbook.SaveAs Filename:="C:\Book2.txt", FileFormat:=xlText, _
CreateBackup:=False
End Sub

Mike F
"MrKermit" wrote in
message ...

Hi

I've got a little problem:
I would like to create with a macro a *.txt file in a specific folder
and copy the content of one the sheet on this *.txt file but I don't
know how to proceed.
In fact, I would be better for me to copy the content of this sheet in
a *.inp file (that is a quite weird extension), but a *.txt file would
be good enough.

Thx for your help


--
MrKermit
------------------------------------------------------------------------
MrKermit's Profile:
http://www.excelforum.com/member.php...o&userid=33021
View this thread: http://www.excelforum.com/showthread...hreadid=531464