Private Sub CommandButton1_Click()
Application.ScreenUpdating = False
Sheets("Корешки").Range("A1:AC200").ClearContents
i = 2
j = 0
Offset1 = 0 'Смещение по вертикали
Offset2 = 0 'Смещение по горизонтали
Do While Sheets("Таблица").Cells(i, 1) <> ""
If Sheets("Таблица").Cells(i, 3) = "да" Then
Sheets("Корешки").Cells(1 + Offset1, 1 + Offset2).Value = Sheets("Таблица").Cells(i, 4)
Sheets("Корешки").Cells(2 + Offset1, 1 + Offset2).Value = "Зарплата"
Sheets("Корешки").Cells(2 + Offset1, 2 + Offset2).Value = Sheets("Таблица").Cells(i, 1)
Sheets("Корешки").Cells(3 + Offset1, 1 + Offset2).Value = "пеработк"
Sheets("Корешки").Cells(3 + Offset1, 2 + Offset2).Value = Sheets("Таблица").Cells(i, 8)
Sheets("Корешки").Cells(4 + Offset1, 1 + Offset2).Value = "премия"
Sheets("Корешки").Cells(4 + Offset1, 2 + Offset2).Value = Sheets("Таблица").Cells(i, 10)
Sheets("Корешки").Cells(5 + Offset1, 1 + Offset2).Value = "Карточка"
Sheets("Корешки").Cells(5 + Offset1, 2 + Offset2).Value = Sheets("Таблица").Cells(i, 9)
Sheets("Корешки").Cells(6 + Offset1, 1 + Offset2).Value = "аванс нал"
Sheets("Корешки").Cells(6 + Offset1, 2 + Offset2).Value = Sheets("Таблица").Cells(i, 14)
Sheets("Корешки").Cells(7 + Offset1, 1 + Offset2).Value = "Итого:"
Sheets("Корешки").Cells(7 + Offset1, 2 + Offset2).Value = Sheets("Таблица").Cells(i, 11)
Sheets("Корешки").Cells(8 + Offset1, 2 + Offset2).Value = Sheets("Таблица").Cells(i, 12)
Sheets("Корешки").Cells(9 + Offset1, 2 + Offset2).Value = Sheets("Таблица").Cells(i, 11) + Sheets("Таблица").Cells(i, 12)
Offset2 = Offset2 + 3
If j = 9 Then
j = 0
Offset1 = Offset1 + 10
Offset2 = 0
Else
j = j + 1
End If
End If
i = i + 1
Loop
Application.ScreenUpdating = True
End Sub