Этот межклеточный доступ будет очень медленным: ваш код будет работать намного быстрее, если вы прочитаете все данные в двумерный массив и получите к нему доступ оттуда.
РЕДАКТИРОВАТЬ обновить на выходе блока
Sub PriceList()
Const CHUNK_SIZE As Long = 100
Dim data, lr As Long, i As Long, repeat As Boolean
Dim output_path As String, myfileFSO, myts
Dim ws As Worksheet, chunkNumber As Long
'** placeholder in output path for chunk number
output_path = CreateObject("WScript.Shell").specialfolders("Desktop") & _
"\blah\Sales Price List-{chunk}.txt"
With ThisWorkbook.Worksheets("Sales Price List")
lr = .Cells(.Rows.Count, 1).End(xlUp).Row
data = .Range(.Range("A4"), .Cells(lr, 15)).Value
End With
chunkNumber = 1
Set myts = OutputFile(output_path, chunkNumber)
For i = 1 To UBound(data, 1)
'repeat row ?
repeat = False 'default
If i > 1 Then repeat = (data(i, 2) = data((i - 1), 2))
If Not repeat Then
myts.write Join(Array("E", data(i, 1), data(i, 2), data(i, 3), data(i, 4)), ";") & vbCrLf
End If
myts.write Join(Array("L", data(i, 5), data(i, 6), data(i, 7), data(i, 8), _
data(i, 9), data(i, 10), data(i, 11), data(i, 12), _
data(i, 13), data(i, 14), data(i, 15)), ";") & vbCrLf
If i Mod CHUNK_SIZE = 0 Then
myts.Close
chunkNumber = chunkNumber + 1
Set myts = OutputFile(output_path, chunkNumber)
End If
Next
MsgBox "Done"
End Sub
Function OutputFile(fPath As String, chunkNumber As Long)
Set OutputFile = CreateObject("Scripting.FileSystemObject"). _
CreateTextFile(Replace(fPath, "{chunk}", chunkNumber))
End Function