Sub Кнопка3_Щелкнуть ()
Dim i, j, k, l, s1, s2, s3, s4, s5, ss, s6, s7, s8, s9, s10 As Single
Dim s As String
Worksheets("паспорт").Activate
i = Worksheets("паспорт").Cells(2, 15).Value
l = Worksheets("паспорт").Cells(5, 8).Value
' Worksheets("ИТОГО (2)").Activate
s = Worksheets("ИТОГО (2)").Cells(i + 6, 2).Value
' Worksheets(s).Activate
For i = 3 To 996
k = Worksheets(s).Cells(i, 3).Value
If l = k Then
s1 = Worksheets(s).Cells(i, 1).Value
s2 = Worksheets(s).Cells(i, 8).Value
s3 = Worksheets(s).Cells(i, 9).Value
s4 = Worksheets(s).Cells(i, 10).Value
s5 = Worksheets(s).Cells(i, 11).Value
s6 = Worksheets(s).Cells(i, 12).Value
ss = InStr(s6, "-")
s7 = Mid(s6, ss + 1)
3 s6 = Mid(s6, 1, ss - 1)
s8 = Worksheets(s).Cells(i, 13).Value
s9 = Worksheets(s).Cells(i, 14).Value
s10 = Worksheets(s).Cells(i, 15).Value
Worksheets("паспорт").Activate
Worksheets("паспорт").Cells(7, 6).Value = s1
Worksheets("паспорт").Cells(16, 6).Value = s2
Worksheets("паспорт").Cells(21, 5).Value = s3
Worksheets("паспорт").Cells(24, 6).Value = s4
Worksheets("паспорт").Cells(26, 6).Value = s5
Worksheets("паспорт").Cells(28, 6).Value = s6
Worksheets("паспорт").Cells(28, 8).Value = s7
Worksheets("паспорт").Cells(30, 7).Value = s8
Worksheets("паспорт").Cells(32, 6).Value = s9
Worksheets("паспорт").Cells(34, 5).Value = s10
End If
' Worksheets(s).Activate
Next i
Worksheets("паспорт").Activate
End Sub
-
Вопрос задан
-
33 просмотра