Я пытаюсь сохранить карту каждого инструмента в виде отдельного текстового файла.
Here's my code. It prints, but everything I try saves 16 repeats of AU2, AU3, or both... per file.
Private Sub Cubase()
Dim c As Range, r As Range, s As Range
Dim LR As Long
Dim output As String
Dim map As String
LR = Cells(Rows.Count, "B").End(xlUp).Row '(columns AQ & B are identical)
Set r = Range("AU2:AU" & LR)
For Each c In r
If c.Offset(0, -2).Value = 1 Then
output = c.Offset(0, -1).Value
map = c.Offset(0, -3).Value
Open output For Output As #1
For Each c In r
If map = c.Offset(0, -4).Value And c.Offset(0, -3).Text > 0 Then
Print #1, c.Value & Chr(10)
End If
Next
End If
Close
Next c
End Sub
Как определить каждый инструмент или список как следующий диапазон для сохранения?