Смекни!
smekni.com

Основы программирования на VBA модель объектов Exel (стр. 3 из 3)

.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

Range("F2").Select

ActiveCell.FormulaR1C1 = "Цена 1 л бензина"

'центровка записи

With Selection.HorizontalAlignment = xlCenter

Selection.VerticalAlignment = xlCenter

Selection.WrapText = True

Selection.Orientation = 0

Selection.AddIndent = True

Selection.IndentLevel = 0

Selection.ShrinkToFit = True

Selection.ReadingOrder = xlContext

Selection.MergeCells = False

Selection.HorizontalAlignment = xlCenter

End With

Columns("F:F").ColumnWidth = 15

Rows("2:2").EntireRow.AutoFit

Columns("F:F").EntireColumn.AutoFit

'установка шрифта

With Selection.Font.Name = "Times New Roman"

Selection.Font.Size = 10

Selection.Font.Strikethrough = False

Selection.Font.Superscript = False

Selection.Font.Subscript = False

Selection.Font.OutlineFont = False

Selection.Font.Shadow = False

Selection.Font.Underline = xlUnderlineStyleNone

Selection.Font.ColorIndex = xlAutomatic

Selection.Font.Bold = True

End With

Selection.Borders(xlDiagonalDown).LineStyle = xlNone

Selection.Borders(xlDiagonalUp).LineStyle = xlNone

With Selection.Borders(xlEdgeTop)

.LineStyle = xlContinuous

.Weight = xlThin

.ColorIndex = xlAutomatic

End With

With Selection.Borders(xlEdgeBottom)

.LineStyle = xlContinuous

.Weight = xlThin

.ColorIndex = xlAutomatic

End With

Range("G2").Select

ActiveCell.FormulaR1C1 = "Общая стоимость"

'центровка записи

With Selection.HorizontalAlignment = xlCenter

Selection.VerticalAlignment = xlCenter

Selection.WrapText = True

Selection.Orientation = 0

Selection.AddIndent = True

Selection.IndentLevel = 0

Selection.ShrinkToFit = True

Selection.ReadingOrder = xlContext

Selection.MergeCells = False

Selection.HorizontalAlignment = xlCenter

End With

Columns("G:G").ColumnWidth = 15

Rows("2:2").EntireRow.AutoFit

Columns("G:G").EntireColumn.AutoFit

'установка шрифта

With Selection.Font.Name = "Times New Roman"

Selection.Font.Size = 10

Selection.Font.Strikethrough = False

Selection.Font.Superscript = False

Selection.Font.Subscript = False

Selection.Font.OutlineFont = False

Selection.Font.Shadow = False

Selection.Font.Underline = xlUnderlineStyleNone

Selection.Font.ColorIndex = xlAutomatic

Selection.Font.Bold = True

End With

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

End Sub


Приложение Б. Экранная копия тестового примера