I tied Save As
my sheet in CSV format with (Comma Delimited) "," for fields and {CR}{LF} for records in line by below code.
The issue is:
1) Generated file is delimited by ";" sign instead of ",".
2) Be sure records are separated by {CR}{LF}
3) How can define encoding as Unicode UTF-8 (in situation if needed)
I want this file have save by .txt extension.
How can I generate CSV file in true format by above situation?
Sub GenCSV()
Dim NewBook As Workbook
Set NewBook = Workbooks.Add
ThisWorkbook.Worksheets("Sheet1").Range("tblTaxRep[[Header1]: _
[Headern]]").SpecialCells(xlCellTypeVisible).Copy
With NewBook
.Worksheets("Sheet1").Cells(1, 1).PasteSpecial (xlPasteValues)
.SaveAs Filename:=ThisWorkbook.Path & "Report" & ".txt", FileFormat:=xlCSV
.Close SaveChanges:=False
End With
End Sub