Save As Text file

H

husky101

Hi NG,
Would appreciate any assistance with this one.
I have searched the NG and not coming up with the right result I need.
I have the following code:

Sub SaveAsTxt()

Sheets("Output").Select
Range("A2").Select
Range(Selection, ActiveCell.SpecialCells(xlLastCell)).Select
Selection.Copy
Workbooks.Add
ActiveSheet.Paste
Application.CutCopyMode = False

ActiveWorkbook.SaveAs Filename:="C:\Sales\" & "Sales" & Format(Now,
"yyyymmddhhmm") & ".txt", FileFormat:=xlText, _
CreateBackup:=False
ActiveWorkbook.Close SaveChanges:=False

Sheets("IMPUT").Select
Range("A2").Select

End Sub

the resulting output is as a TAB delimited text file.
I require COMMA ( , ) delimited, and contents with Double Quotes (""),
including blank fields.

Thanks in advance.
Cheers Paul
 

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