c = h - b
If c = 0 Then c = c + 26
stroka2 = Mid (st1, c, 1)
st2 = stroka1 + stroka2
Else
st2 = Mid (st1, h, 1)
End If
If h = 26 Then
st2 = Mid (st1, 26, 1)
End If
Range (Trim (st2) + Trim (Str (i))). Select
With Selection.Interior
. ColorIndex = 33
. Pattern = xlSolid
. PatternColorIndex = xlAutomatic
End With
Next i
Range ("C2"). Select
End Sub
Sub Solut ()
Dim fl As Boolean
Dim flag As Boolean
Dim remnach As Integer
Dim remkon As Integer
Dim remdl As Double
Dim maxdl As Double
Dim putt As Boolean
scount = 1
'Введення в таблицю результатів початкових даних
For i = 2 To n + 1
For j = 2 To n + 1
If Not ActiveSheet.Cells (i, j). Value = "" Then
scount = scount + 1
Sheets ("Rez"). Cells (scount, 1). Value = i - 1
Sheets ("Rez"). Cells (scount, 2). Value = j - 1
Sheets ("Rez"). Cells (scount, 3). Value = ActiveSheet.Cells (i, j). Value
End If
Next j
Next i
'Пошук початкових етапів
For i = 2 To n + 1
fl = False
For j = 2 To n + 1
If Not ActiveSheet.Cells (j, i). Value = "" Then
fl = True
End If
Next j
If fl = False Then
For j = 2 To scount
If Sheets ("Rez"). Cells (j, 1). Value = i - 1 Then
Sheets ("Rez"). Cells (j, 4). Value = 0
Sheets ("Rez"). Cells (j, 5). Value = Sheets ("Rez"). Cells (j, 4). Value + Sheets ("Rez"). Cells (j, 3). Value
End If
Next j
End If
Next i
'Заповнення раннього початку і кінця
flag = True
Do While flag = True
flag = False
For i = 2 To scount
If Not Sheets ("Rez"). Cells (i, 4). Value = "" Then
remkon = Sheets ("Rez"). Cells (i, 2)
remdl = Sheets ("Rez"). Cells (i, 5)
For j = 2 To scount
If Sheets ("Rez"). Cells (j, 2). Value = remkon Then
If remdl
remdl = Sheets ("Rez"). Cells (j, 5). Value
End If
End If
Next j
For j = 2 To scount
If Sheets ("Rez"). Cells (j, 1). Value = remkon Then
Sheets ("Rez"). Cells (j, 4). Value = remdl
Sheets ("Rez"). Cells (j, 5). Value = Sheets ("Rez"). Cells (j, 4). Value + Sheets ("Rez"). Cells (j, 3). Value
End If
Next j
End If
Next i
For i = 2 To scount
If Sheets ("Rez"). Cells (i, 4). Value = "" Then
flag = True
End If
Next i
Loop
'Визначення тривалості проекту
maxdl = Sheets ("Rez"). Cells (2, 5). Value
For i = 2 To scount
If maxdl