АВТОМАТИЗАЦIЯ КОНТРОЛЮ ВIДВIДУВАННЯ СТУДЕНТАМИ ЗАНЯТЬ
M = 1
For Each Wh In Worksheets
If Mid(Wh.Name, 3, 1) = "-" Then
A(M) = Wh.Name + Sheets(Wh.Name).Range("C1")
A(M) = A(M) + Space(30 - Len(A(M))) + "(Лист " + Wh.Name + ")"
M = M + 1
End If
Next
Sort
For I = 1 To M - 1
d = A(I)
A(I) = Mid(A(I), 7, 10) + " " + "Група " + Mid(A(I), 4, 3)
A(I) = A(I) + Space(30 - Len(A(I))) + Mid(d, 30)
Next I
For I = 1 To M - 1
ListBox1.AddItem (A(I))
Next I
End Sub
Текст макроса Sort на листі “Звіт”
Dim A(500)
Dim M
Sub Sort()
For I = 1 To M - 1
For J = 1 To I - 1
If A(I) < A(J) Then