If w(i, j) = "-" And i <> k And j <> r And i <> k1 And j <> r1 Then l2 = postavka(i, j): k2 = i: r2 = j: Exit For
Next j
Next i
For i = 1 To 7 Step 1
For j = 1 To 7 Step 1
If w(i, j) = "-" And i <> k And j <> r And i <> k1 And j <> r1 And i <> k2 And j <> r2 Then
l3 = postavka(i, j): k3 = i: r3 = j: Exit For
End If
Next j
Next i
For i = 1 To 7 Step 1
For j = 1 To 7 Step 1
If w(i, j) = "-" Then postavka(i, j) = postavka(i, j) - min(l, min(l1, min(l2, l3)))
If w(i, j) = "+" Then postavka(i, j) = postavka(i, j) + min(l, min(l1, min(l2, l3)))
Next j
Next i
For i = 1 To 7 Step 1
For j = 1 To 7 Step 1
Worksheets("Лист1").Cells(i + 15, j + 8) = postavka(i, j)
Next j
Next i
If a <= b Then
If min(l, min(l1, min(l2, l3))) = l Then Worksheets("Лист1").Cells(k + 6, r + 8) = "."
If min(l, min(l1, min(l2, l3))) = l1 Then Worksheets("Лист1").Cells(k1 + 6, r1 + 8) = "."
If min(l, min(l1, min(l2, l3))) = l2 Then Worksheets("Лист1").Cells(k2 + 6, r2 + 8) = "."
If min(l, min(l1, min(l2, l3))) = l3 Then Worksheets("Лист1").Cells(k3 + 6, r3 + 8) = "."
End If
If a > b Then
If min(l, min(l1, min(l2, l3))) = l Then Worksheets("Лист1").Cells(r + 6, k + 8) = "."
If min(l, min(l1, min(l2, l3))) = l1 Then Worksheets("Лист1").Cells(r1 + 6, k1 + 8) = "."
If min(l, min(l1, min(l2, l3))) = l2 Then Worksheets("Лист1").Cells(r2 + 6, k2 + 8) = "."
If min(l, min(l1, min(l2, l3))) = l3 Then Worksheets("Лист1").Cells(r3 + 6, k3 + 8) = "."
End If
End If
If s = 5 Then
For i = 1 To 7 Step 1
For j = 1 To 7 Step 1
If w(i, j) = "-" Then l = postavka(i, j): k = i: r = j: Exit For
Next j
Next i
For i = 1 To 7 Step 1
For j = 1 To 7 Step 1
If w(i, j) = "-" And i <> k And j <> r Then l1 = postavka(i, j): k1 = i: r1 = j: Exit For
Next j
Next i
For i = 1 To 7 Step 1
For j = 1 To 7 Step 1
If w(i, j) = "-" And i <> k And j <> r And i <> k1 And j <> r1 Then l2 = postavka(i, j): k2 = i: r2 = j: Exit For
Next j
Next i
For i = 1 To 7 Step 1
For j = 1 To 7 Step 1
If w(i, j) = "-" And i <> k And j <> r And i <> k1 And j <> r1 And i <> k2 And j <> r2 Then
l3 = postavka(i, j): k3 = i: r3 = j: Exit For
End If
Next j
Next i
For i = 1 To 7 Step 1
For j = 1 To 7 Step 1
If w(i, j) = "-" And i <> k And j <> r And i <> k1 And j <> r1 And i <> k2 And j <> r2 And i <> k3 And j <> r3 Then
l4 = postavka(i, j): k4 = i: r4 = j: Exit For
End If
Next j
Next i
For i = 1 To 7 Step 1
For j = 1 To 7 Step 1
If w(i, j) = "-" Then postavka(i, j) = postavka(i, j) - min(l, min(l1, min(l2, min(l3, l4))))
If w(i, j) = "+" Then postavka(i, j) = postavka(i, j) + min(l, min(l1, min(l2, min(l3, l4))))
Next j
Next i
For i = 1 To 7 Step 1
For j = 1 To 7 Step 1
Worksheets("Лист1").Cells(i + 15, j + 8) = postavka(i, j)
Next j
Next i
' If a <= b Then
If min(l, min(l1, min(l2, min(l3, l4)))) = l Then Worksheets("Лист1").Cells(k + 6, r + 8) = "."
If min(l, min(l1, min(l2, min(l3, l4)))) = l1 Then Worksheets("Лист1").Cells(k1 + 6, r1 + 8) = "."
If min(l, min(l1, min(l2, min(l3, l4)))) = l2 Then Worksheets("Лист1").Cells(k2 + 6, r2 + 8) = "."
If min(l, min(l1, min(l2, min(l3, l4)))) = l3 Then Worksheets("Лист1").Cells(k3 + 6, r3 + 8) = "."
If min(l, min(l1, min(l2, min(l3, l4)))) = l4 Then Worksheets("Лист1").Cells(k4 + 6, r4 + 8) = "."
End If
If a > b Then
If min(l, min(l1, min(l2, min(l3, l4)))) = l Then Worksheets("Лист1").Cells(r + 6, k + 8) = "."
Уважаемый посетитель!
Чтобы распечатать файл, скачайте его (в формате Word).
Ссылка на скачивание - внизу страницы.