)) Then
Columns (i). Hidden = True
End If
Next i
CommandButton2.Caption = "Показати приховані стовпці "
Else
For i = 2 To 8
If Columns (i). Hidden = True Then
Columns (i). Hidden = False
End If
Next i
For i = 9 To 16
If Columns (i). Hidden = True Then
Columns (i). Hidden = False
End If
Next i
For i = 18 To 24
If Columns (i). Hidden = True Then
Columns (i). Hidden = False
End If
Next i
For i = 26 To 32
If Columns (i). Hidden = True Then
Columns (i). Hidden = False
End If
Next i
For i = 34 To 40
If Columns (i). Hidden = True Then
Columns (i). Hidden = False
End If
Next i
For i = 42 To 48
If Columns (i). Hidden = True Then
Columns (i). Hidden = False
End If
Next i
For i = 50 To 56
If Columns (i). Hidden = True Then
Columns (i). Hidden = False
End If
Next i
CommandButton2.Caption = "Сховати порожні стовпці "
End If
End Sub
Додаток 2
Макрос В«ItogiВ»
Private Sub CommandButton1_Click ()
Dim intTarray (1 To 11) As Integer
For i = 5 To 76
s = Worksheets ("Лист1"). Cells (i, 1). Value
s1 = Left (s, Len (s) - 1)
intTarray (Val (s1)) = IntTarray (Val (s1)) + 1
Nexti
For i = 7 To 100
For j = 1 To 7
Worksheets ("Лист2"). Cells (i, j). Value = ""
Next j
Next i
k = 6
For i = 2 To 11
For j = 5 To 76
s = Worksheets ("Лист1"). Cells (j, 1). Value
If Len (s) <> 0 Then
If Len (s)> 1 Then r = 2 Else r = 1
If Val (Left (s, r)) = i Then
s0 = Worksheets ("Лист1"). Cells (j, 2). Value
S1 = Worksheets ("Лист1"). Cells (j, 6). Value
S11 = S11 + S1
s2 = Worksheets ("Лист1"). Cells (j, 7). Value
s12 = S12 + s2
S3 = Worksheets ("Лист1"). Cells (j, 8). Value
s31 = S31 + S3
s4 = Worksheets ("Лист1"). Cells (j, 9). Value
s41 = S41 + s4
s5 = Worksheets ("Лист1"). Cells (j, 10). Value
s15 = S15 + s5
k = K + 1
Worksheets ("Лист2"). Cells (k, 1). Value = s
Worksheets ("Лист2"). Cells (k, 2). Value = s0
Worksheets ("Лист2"). Cells (k, 3). Value = S1 & "/" & s2
Worksheets ("Лист2"). Cells (k, 6). Value = S3 & "(" & s4 & ")"
Worksheets ("Лист2"). Cells (k, 4). Value = s5
If S1 = "" Or s2 = "" Then
Worksheets ("Лист2"). Cells (k, 5). Value = ""
Else
Worksheets ("Лист2"). Cells (k, 5). Value = Str (Round (100 * (Val (S1) - Val (s5))/Val (S1))) & "%"
KLASS = KLASS + 1
A = A + Round (100 * (Val (S1) - Val (s5))/Val (S1))
End If
If S1 = "" Or S3 = "" Then Worksheets ("Лист2"). Cells (k, 7). Value = "" Else Worksheets ("Лист2"). Cells (k, 7). Value = Str (Round (100 * Val (S3)/Val (S1))) & "%"
s10 = S10 + Val (S1)
s20 = S20 + Val (s2)
s30 = S30 + Val (S3)
s40 = S40 + Val (s4)
S50 = S50 + Val (s5)
End If
End If
Next j
k = K + 1
Worksheets ("Лист2"). Cells (k, 2). Value = "Разом"
Worksheets ("Лист2"). Cells (k, 3). Value = Str (s10) & "/" & Str (s20)
Worksheets ("Лист2"). Cells (k, 4). Value = Str (S50)
Worksheets ("Лист2"). Cells (k, 5). Value = Str (Round (100 * (s10 - S50)/s10)) & "%"
Worksheets ("Лист2"). Cells (k, 6). Value = Str (s30) & "(" & Str (s40) & ")"
Worksheets ("Лист2"). Cells (k, 7). Value = Str (Round (100 * s30/s10)) & "%"
k = K + 1
If (I = 4) Or (i = 9) Or (i = 11) Then
Worksheets ("Лист2"). Cells (k, 2). Font.Bold = True
Worksheets ("Лист2"). Cells (k, 2). Value = "Разом по ступені"
Worksheets ("Лист2"). Cells (k, 3). Font.Bold = True
Worksheets ("Лист2"). Cells (k, 3). Value = S11 & "/" & s12
Worksheets ("Лист2"). Cells (k, 4). Font.Bold = True
Worksheets ("Лист2"). Cells (k, 4). Value = s15
Worksheets ("Лист2"). Cells (k, 5). Font.Bold = True
Worksheets ("Лист2"). Cells (k, 5). Value = Str (Round (A/KLASS)) & "%"
Worksheets ("Лист2"). Cells (k, 6). Font.Bold = True
Worksheets ("Лист2"). Cells (k, 6). Value = Str (s31) & "(" & Str (s41) & ")"
A = 0
KLASS = 0
s15 = 0
Worksheets ("Лист2"). Cells (k, 7). Font.Bold = True
Worksheets ("Лист2"). Cells (k, 7). Value = Str (Round (100 * s31/S11)) & "%"
s31 = 0
s41 = 0
S11 = 0
k = K + 1
End If
s100 = S100 + s10
s200 = S200 + s20
s300 = S300 + s...