Save sheet as .TXT out of Workbook

G

goepf

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!
 
B

BrianB

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


Regards
BrianB
================================================================
 
G

goepf

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
 

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

Top