Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]() Hi I've got a little problem: I would like to create with a macro a *.txt file in a specific folde and copy the content of one the sheet on this *.txt file but I don' know how to proceed. In fact, I would be better for me to copy the content of this sheet i a *.inp file (that is a quite weird extension), but a *.txt file woul be good enough. Thx for your hel -- MrKermi ----------------------------------------------------------------------- MrKermit's Profile: http://www.excelforum.com/member.php...fo&userid=3302 View this thread: http://www.excelforum.com/showthread.php?threadid=53146 |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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 |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
You might want to add
Sub NewTextFile() Sheets("Sheet1").Copy 'ChDir "C:\" 'your folder path ActiveWorkbook.SaveAs Filename:="C:\Book2.txt", _ FileFormat:=xlText, _ CreateBackup:=False ActiveWorkbook.Close SaveChanges:=False End Sub You also don't need to chdir since the path is specified in the file name. If you did need to Chdir, you should also Chdrive as well. -- Regards, Tom Ogilvy "Mike Fogleman" wrote: 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 |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]() Ok thanks, i'm gonna tr -- MrKermi ----------------------------------------------------------------------- MrKermit's Profile: http://www.excelforum.com/member.php...fo&userid=3302 View this thread: http://www.excelforum.com/showthread.php?threadid=53146 |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
How do i create macro for export excel data to word in to letters | Excel Discussion (Misc queries) | |||
how do i create a macro to export a chart to powerpoint? | Charts and Charting in Excel | |||
Need to export file name to users sheet to the next row | Excel Programming | |||
A macro to export a sheet as UTF8 encoded Unicode file | Excel Programming | |||
Do you know how to create a new sheet in a file by macro? | Excel Programming |