Код макроса Макрос1

Sub Макрос1()

'

' Макрос1 Макрос

' Макрос записан 04.12.2012 (Вячеслав)

'

'

Range("A1").Select

ActiveCell.FormulaR1C1 = "Таблица расчета зарплаты"

Range("A2").Select

ActiveCell.FormulaR1C1 = "ФИО"

Range("A3").Select

ActiveCell.FormulaR1C1 = "Иванов"

Range("A4").Select

ActiveCell.FormulaR1C1 = "Петров"

Range("A5").Select

ActiveCell.FormulaR1C1 = "Сидоров"

Range("A6").Select

ActiveCell.FormulaR1C1 = "Итого"

Range("B2").Select

ActiveCell.FormulaR1C1 = "Оклад"

Range("C2").Select

ActiveCell.FormulaR1C1 = "Премия"

Range("D2").Select

ActiveCell.FormulaR1C1 = "К выдаче"

Range("B3").Select

ActiveCell.FormulaR1C1 = "10000"

Range("B4").Select

ActiveCell.FormulaR1C1 = "15000"

Range("B5").Select

ActiveCell.FormulaR1C1 = "20000"

Range("C3").Select

ActiveCell.FormulaR1C1 = "1000"

Range("C4").Select

ActiveCell.FormulaR1C1 = "2000"

Range("C5").Select

ActiveCell.FormulaR1C1 = "3000"

Range("D3").Select

ActiveCell.FormulaR1C1 = "=(RC[-2]+RC[-1])*(1-0.12)"

Range("D3").Select

Selection.AutoFill Destination:=Range("D3:D5"), Type:=xlFillDefault

Range("D3:D5").Select

Range("B6").Select

ActiveCell.FormulaR1C1 = "=SUM(R[-3]C:R[-1]C)"

Range("B6").Select

Selection.AutoFill Destination:=Range("B6:D6"), Type:=xlFillDefault

Range("B6:D6").Select

Range("A1:D1").Select

With Selection

.HorizontalAlignment = xlCenter

.VerticalAlignment = xlBottom

.WrapText = False

.Orientation = 0

.AddIndent = False

.IndentLevel = 0

.ShrinkToFit = False

.ReadingOrder = xlContext

.MergeCells = False

End With

Selection.Merge

Selection.Font.Bold = True

Range("A2:D6").Select

Selection.Borders(xlDiagonalDown).LineStyle = xlNone

Selection.Borders(xlDiagonalUp).LineStyle = xlNone

With Selection.Borders(xlEdgeLeft)

.LineStyle = xlContinuous

.Weight = xlThin

.ColorIndex = xlAutomatic

End With

With Selection.Borders(xlEdgeTop)

.LineStyle = xlContinuous

.Weight = xlThin

.ColorIndex = xlAutomatic

End With

With Selection.Borders(xlEdgeBottom)

.LineStyle = xlContinuous

.Weight = xlThin

.ColorIndex = xlAutomatic

End With

With Selection.Borders(xlEdgeRight)

.LineStyle = xlContinuous

.Weight = xlThin

.ColorIndex = xlAutomatic

End With

With Selection.Borders(xlInsideVertical)

.LineStyle = xlContinuous

.Weight = xlThin

.ColorIndex = xlAutomatic

End With

With Selection.Borders(xlInsideHorizontal)

.LineStyle = xlContinuous

.Weight = xlThin

.ColorIndex = xlAutomatic


Понравилась статья? Добавь ее в закладку (CTRL+D) и не забудь поделиться с друзьями:  



double arrow
Сейчас читают про: