ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Save sheet as .TXT out of Workbook (https://www.excelbanter.com/excel-programming/282344-save-sheet-txt-out-workbook.html)

goepf

Save sheet as .TXT out of Workbook
 

I'd like to save a sheet as a .txt file out of my workbook without
closing the actual workbook and keeping the workbook as my .xls
format.

Thanks for any help!


------------------------------------------------
~~ Message posted from http://www.ExcelTip.com/
~~View and post usenet messages directly from http://www.ExcelForum.com/


BrianB

Save sheet as .TXT out of Workbook
 
Use the sheet copy method to copy as a new workbook then do File/Save As on that.


Regards
BrianB
================================================== ==============


goepf wrote in message ...
I'd like to save a sheet as a .txt file out of my workbook without
closing the actual workbook and keeping the workbook as my .xls
format.

Thanks for any help!


------------------------------------------------
~~ Message posted from http://www.ExcelTip.com/
~~View and post usenet messages directly from http://www.ExcelForum.com/


goepf[_2_]

Save sheet as .TXT out of Workbook
 

Thanks that's what I did. If it helps somebody, here is an example fo
code:

Dim FileName As String, path As String, DLSfile As String

FileName = Windows.Application.ActiveWorkbook.Name
path = "DestinationPath"

Sheets("toCopy").Select
Sheets("toCopy").Copy
DLSfile = "DL72112.txt"
ActiveWorkbook.SaveAs FileName:=path & DLSfile, fileFormat:=xlText
CreateBackup:=False
ActiveWindow.Clos

-----------------------------------------------
~~ Message posted from http://www.ExcelTip.com
~~View and post usenet messages directly from http://www.ExcelForum.com



All times are GMT +1. The time now is 04:16 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com