See this or this or this for examples of writing a .csv file instead of saving to one.
Below is code extracted from the first example ...
Sub makeCSV(theSheet As Worksheet)
Dim iFile As Long, myPath As String
Dim myArr() As Variant, outStr As String
Dim iLoop As Long, jLoop As Long
myPath = Application.ActiveWorkbook.Path
iFile = FreeFile
Open myPath & "\myCSV.csv" For Output Lock Write As #iFile
myArr = theSheet.UsedRange
For iLoop = LBound(myArr, 1) To UBound(myArr, 1)
outStr = ""
For jLoop = LBound(myArr, 2) To UBound(myArr, 2) - 1
If InStr(1, myArr(iLoop, jLoop), ",") Then
outStr = outStr & """" & myArr(iLoop, jLoop) & """" & ","
Else
outStr = outStr & myArr(iLoop, jLoop) & ","
End If
Next jLoop
If InStr(1, myArr(iLoop, jLoop), ",") Then
outStr = outStr & """" & myArr(iLoop, UBound(myArr, 2)) & """"
Else
outStr = outStr & myArr(iLoop, UBound(myArr, 2))
End If
Print #iFile, outStr
Next iLoop
Close iFile
Erase myArr
End Sub
modified to deal with unusual shaped ranges
Sub makeCSV(theSheet As Worksheet)
Dim iFile As Long, myPath As String
Dim myArr() As Variant, outStr As String
Dim iLoop As Long, jLoop As Long
Dim lastCol As Long
' set up output file
myPath = Application.ActiveWorkbook.Path
iFile = FreeFile
Open myPath & "\myCSV.csv" For Output Lock Write As #iFile
myArr = theSheet.UsedRange
For iLoop = LBound(myArr, 1) To UBound(myArr, 1) ' loop through all rows
outStr = ""
lastCol = UBound(myArr, 2) ' find last column with data in it
For jLoop = UBound(myArr, 2) To LBound(myArr, 2) Step -1
If myArr(iLoop, jLoop) = "" Then
lastCol = jLoop - 1
Else
Exit For
End If
Next jLoop
For jLoop = LBound(myArr, 2) To lastCol - 1 ' loop until second last column
If InStr(1, myArr(iLoop, jLoop), ",") Then
outStr = outStr & """" & myArr(iLoop, jLoop) & """" & ","
Else
outStr = outStr & myArr(iLoop, jLoop) & ","
End If
Next jLoop
If InStr(1, myArr(iLoop, jLoop), ",") Then ' last column has no "," after it
outStr = outStr & """" & myArr(iLoop, lastCol) & """"
Else
outStr = outStr & myArr(iLoop, lastCol)
End If
Print #iFile, outStr
Next iLoop
'clean up
Close iFile
Erase myArr
End Sub