mike7952 was kind enough to help me with a challenge creating a csv from a single sheet in my workbook to use as an import file for our ERP software. What I have now found out is the software we use is very buggy with formatting. Result, some files work and some return odd errors recognizing the data. I'm told if I can wrap the values in the csv with quotes, it will likely eliminate the random formatting errors. Is there a way to add to mike7952's script (below) to format the data in the csv wrapped with quotes? I also attached a sample copy of my workbook. Thanks in advance if anyone can provide some ideas!!! Best regards...Brett
Sub Create_ITEM_CSV()
Dim wks As Worksheet
Dim newWb As Workbook
Set wks = Worksheets("ITEMIMPORT")
wks.Copy 'to a new workbook
Set newWb = ActiveWorkbook
With Application
.DisplayAlerts = False
With newWb
.SaveAs Filename:="C:\Users\Mike\Desktop\" & wks.Name & ".csv", FileFormat:=xlCSVMSDOS
.Close SaveChanges:=True
End With
.DisplayAlerts = True
End With
Set wks = Nothing
Set newWb = Nothing
End Sub
Bookmarks