Вы можете использовать процедуру, которая создает массив и преобразует его в csv в качестве параметра.
Sub ExportSheetsToCSV()
Dim Ws As Worksheet
Dim xcsvFile As String
Dim vDB1 As Variant, vDB2 As Variant, vDB() As Variant
Dim r As Long, i As Long, j As Integer
Set Ws = ActiveSheet
xcsvFile = CurDir & "\" & Ws.Name & ".csv"
vDB1 = Range("Berechnung!$A$10811:$A$39611")
vDB2 = Range("Berechnung!$BA$10811:$BC$39611")
r = UBound(vDB1, 1)
ReDim vDB(1 To r, 1 To 4)
For i = 1 To r
vDB(i, 1) = vDB1(i, 1)
For j = 1 To 3
vDB(i, j + 1) = vDB2(i, j)
Next j
Next i
TransToCSV xcsvFile, vDB
MsgBox ("Files Saved Successfully")
End Sub
Sub TransToCSV(myfile As String, vDB As Variant)
Dim vR() As String, vTxt()
Dim i As Long, n As Long, j As Integer
Dim objStream
Dim strTxt As String
Set objStream = CreateObject("ADODB.Stream")
For i = 1 To UBound(vDB, 1)
n = n + 1
ReDim vR(1 To UBound(vDB, 2))
For j = 1 To UBound(vDB, 2)
vR(j) = vDB(i, j)
Next j
ReDim Preserve vTxt(1 To n)
vTxt(n) = Join(vR, ",")
Next i
strTxt = Join(vTxt, vbCrLf)
With objStream
.Open
.WriteText strTxt
.SaveToFile myfile, 2
.Close
End With
Set objStream = Nothing
End Sub