Sub format_table()
Dim i As Integer
If Selection.Rows.Count < 7 Or Selection.Columns.Count < 3 Then Exit Sub
Selection.ClearFormats
With Selection.Interior
.ColorIndex = 2
.Pattern = xlSolid
.PatternColorIndex = xlAutomatic
End With
With Selection
.Interior.ColorIndex = 2
.Rows(1).Borders(xlEdgeTop).Weight = xlThin
.Rows(3).Borders(xlEdgeTop).Weight = xlThin
.Rows(3).Borders(xlEdgeBottom).Weight = xlThin
.Rows(3).HorizontalAlignment = xlRight
.Rows(.Rows.Count).Borders(xlEdgeTop).Weight = xlHairline
.Rows(.Rows.Count).Borders(xlEdgeBottom).Weight = xlHairline
With Range(.Cells(1, 1), .Cells(3, .Columns.Count)).Font
.Name = "Arial"
.Size = 8
.Bold = True
.ColorIndex = 11
End With
With .Rows(.Rows.Count).Font
.Name = "Arial"
.Size = 8
.ColorIndex = 11
End With
With Range(.Cells(4, 1), .Cells(.Rows.Count - 2, .Columns.Count))
.Font.Name = "Arial"
.Font.Size = 10
.NumberFormat = "0"
End With
End With
End Sub