страница 1 |
|||||||||||||||||||||||||||||||||||||||||||
Похожие работы
|
Создание макроса в Microsoft Office Excel - страница №1/1
![]() Государственное бюджетное общеобразовательное учреждение среднего профессионального образования Свердловской области «Нижнетагильский техникум информационных технологий сервиса и предпринимательства» Отчет на тему «Создание макроса в Microsoft Office Excel» Группа 13-ДО Р.Ш.Эшанкулова 2011г.
Отчёт по созданию макроса в Microsoft Office Excel. СЧЕТ ФАКТУРА
![]()
![]() Private Sub CommandButton1_Click() 'Ввод наименования товара Cells(Cells(1, 1).Value, 1).Value = TextBox1.Text Cells(Cells(1, 1).Value, 2).Value = TextBox2.Text Cells(Cells(1, 1).Value, 3).Value = TextBox3.Text Cells(Cells(1, 1).Value, 4).Value = TextBox4.Text Cells(Cells(1, 1).Value, 5).Value = Cells(Cells(1, 1).Value, 3).Value * Cells(Cells(1, 1).Value, 4).Value Cells(Cells(1, 1).Value, 7).Value = "20%" Cells(Cells(1, 1).Value, 8).Value = Cells(Cells(1, 1).Value, 5).Value * Cells(Cells(1, 1).Value, 7).Value Cells(Cells(1, 1).Value, 9).Value = Cells(Cells(1, 1).Value, 5).Value + Cells(Cells(1, 1).Value, 8).Value For i = 1 To 11 Cells(Cells(1, 1).Value, i).Borders(xlDiagonalDown).LineStyle = xlNone Cells(Cells(1, 1).Value, i).Borders(xlDiagonalUp).LineStyle = xlNone With Cells(Cells(1, 1).Value, i).Borders(xlEdgeLeft) .LineStyle = xlContinuous .ColorIndex = 0 .TintAndShade = 0 .Weight = xlThin End With
With Cells(Cells(1, 1).Value, i).Borders(xlEdgeTop) .LineStyle = xlContinuous .ColorIndex = 0 .TintAndShade = 0 .Weight = xlThin End With
With Cells(Cells(1, 1).Value, i).Borders(xlEdgeBottom) .LineStyle = xlContinuous .ColorIndex = 0 .TintAndShade = 0 .Weight = xlThin End With
With Cells(Cells(1, 1).Value, i).Borders(xlEdgeRight) .LineStyle = xlContinuous .ColorIndex = 0 .TintAndShade = 0 .Weight = xlThin End With
Cells(Cells(1, 1).Value, i).Borders(xlInsideVertical).LineStyle = xlNone Cells(Cells(1, 1).Value, i).Borders(xlInsideHorizontal).LineStyle = xlNone Next i Cells(1, 1) = Cells(1, 1) + 1 UserForm1.Hide End Sub
UserForm1.Show For i = 23 To Cells(1, 1).Value - 1 Cells(Cells(1, 1).Value, 8) = Cells(Cells(1, 1).Value, 8) + Cells(i, 8) Cells(Cells(1, 1).Value, 9) = Cells(Cells(1, 1).Value, 9) + Cells(i, 9) Next i Cells(Cells(1, 1).Value, 1).Value = "Итого к оплате" For i = 8 To 9 Cells(Cells(1, 1).Value, i).Borders(xlDiagonalDown).LineStyle = xlNone Cells(Cells(1, 1).Value, i).Borders(xlDiagonalUp).LineStyle = xlNone With Cells(Cells(1, 1).Value, i).Borders(xlEdgeLeft) .LineStyle = xlContinuous .ColorIndex = 0 .TintAndShade = 0 .Weight = xlThin End With With Cells(Cells(1, 1).Value, i).Borders(xlEdgeTop) .LineStyle = xlContinuous .ColorIndex = 0 .TintAndShade = 0 .Weight = xlThin End With With Cells(Cells(1, 1).Value, i).Borders(xlEdgeBottom) .LineStyle = xlContinuous .ColorIndex = 0 .TintAndShade = 0 .Weight = xlThin End With With Cells(Cells(1, 1).Value, i).Borders(xlEdgeRight) .LineStyle = xlContinuous .ColorIndex = 0 .TintAndShade = 0 .Weight = xlThin End With With Cells(Cells(1, 1).Value, i).Borders(xlInsideVertical) .LineStyle = xlContinuous .ColorIndex = 0 .TintAndShade = 0 .Weight = xlThin End With With Cells(Cells(1, 1).Value, i).Borders(xlInsideHorizontal) .LineStyle = xlContinuous .ColorIndex = 0 .TintAndShade = 0 .Weight = xlThin End With Cells(Cells(1, 1).Value, i).Borders(xlInsideVertical).LineStyle = xlNone Cells(Cells(1, 1).Value, i).Borders(xlInsideHorizontal).LineStyle = xlNone Next i
Cells(Cells(1, 1).Value + 3, 1) = "Руководитель организции:" For i = 2 To 3 Cells(Cells(1, 1).Value + 3, i).Borders(xlDiagonalDown).LineStyle = xlNone Cells(Cells(1, 1).Value + 3, i).Borders(xlDiagonalUp).LineStyle = xlNone Cells(Cells(1, 1).Value + 3, i).Borders(xlEdgeLeft).LineStyle = xlNone Cells(Cells(1, 1).Value + 3, i).Borders(xlEdgeTop).LineStyle = xlNone With Cells(Cells(1, 1).Value + 3, i).Borders(xlEdgeBottom) .LineStyle = xlContinuous .ColorIndex = 0 .TintAndShade = 0 .Weight = xlThin End With
Cells(Cells(1, 1).Value + 3, i).Borders(xlEdgeRight).LineStyle = xlNone Cells(Cells(1, 1).Value + 3, i).Borders(xlInsideVertical).LineStyle = xlNone Cells(Cells(1, 1).Value + 3, i).Borders(xlInsideHorizontal).LineStyle = xlNone Next i
Cells(Cells(1, 1).Value + 4, 1) = "(индевидуальный предприниматель)" Cells(Cells(1, 1).Value + 3, 7) = "Главный бухгалтер:" For i = 8 To 11 Cells(Cells(1, 1).Value + 3, i).Borders(xlDiagonalDown).LineStyle = xlNone Cells(Cells(1, 1).Value + 3, i).Borders(xlDiagonalUp).LineStyle = xlNone Cells(Cells(1, 1).Value + 3, i).Borders(xlEdgeLeft).LineStyle = xlNone Cells(Cells(1, 1).Value + 3, i).Borders(xlEdgeTop).LineStyle = xlNone With Cells(Cells(1, 1).Value + 3, i).Borders(xlEdgeBottom) .LineStyle = xlContinuous .ColorIndex = 0 .TintAndShade = 0 .Weight = xlThin End With Cells(Cells(1, 1).Value + 3, i).Borders(xlEdgeRight).LineStyle = xlNone Cells(Cells(1, 1).Value + 3, i).Borders(xlInsideVertical).LineStyle = xlNone Cells(Cells(1, 1).Value + 3, i).Borders(xlInsideHorizontal).LineStyle = xlNone Next i Cells(Cells(1, 1).Value + 4, 7) = "(реквизиты свидетельства о государственной" Cells(Cells(1, 1).Value + 5, 7) = "регистрации индевидуального предпринимательства)" For i = 7 To 8 Cells(Cells(1, 1).Value + 6, i).Borders(xlDiagonalDown).LineStyle = xlNone Cells(Cells(1, 1).Value + 6, i).Borders(xlDiagonalUp).LineStyle = xlNone Cells(Cells(1, 1).Value + 6, i).Borders(xlEdgeLeft).LineStyle = xlNone Cells(Cells(1, 1).Value + 6, i).Borders(xlEdgeTop).LineStyle = xlNone With Cells(Cells(1, 1).Value + 6, i).Borders(xlEdgeBottom) .LineStyle = xlContinuous .ColorIndex = 0 .TintAndShade = 0 .Weight = xlThin End With
Cells(Cells(1, 1).Value + 6, i).Borders(xlEdgeRight).LineStyle = xlNone Cells(Cells(1, 1).Value + 6, i).Borders(xlInsideVertical).LineStyle = xlNone Cells(Cells(1, 1).Value + 6, i).Borders(xlInsideHorizontal).LineStyle = xlNone Next i
Cells(Cells(1, 1).Value + 7, 7) = "(подпись ответственного лица)" Cells(1, 1).Value = Cells(1, 1).Value + 1 End Sub В итоге получаем отредактированную и заполненную таблицу. ![]() |