Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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 |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Need to use "csv" file format instead of just txt (FileFormat:=xlCSV)
Tim. wrote in message ups.com... 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 |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Thanks Tim, that's a help.
Cheers Paul Tim Williams wrote: Need to use "csv" file format instead of just txt (FileFormat:=xlCSV) Tim. |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
How do you save an excel file to be read as IBM-type text file ? | Excel Worksheet Functions | |||
Save CSV file as Pipe delimited text file | Excel Discussion (Misc queries) | |||
How can I save a file as a comma-delimited text file in Excel? | Excel Discussion (Misc queries) | |||
Excel VBA - open text file, replace text, save file? | Excel Programming | |||
Save As - Multiple Sheets fails to save as text file | Excel Programming |