Kamyk,
Sub test()
With Selection
With .Font
.Name = "Times New Roman"
.Size = 20
End With
.Interior.ColorIndex = 3 'red
.Borders(xlEdgeTop).Weight = xlthin
End With
End Sub
A good way to figure out things like this is to turn on the macro recorder
and perform the actions you want to program, and then look at the resulting
code. I did so and came up with this:
Sub Macro1()
'
' Macro1 Macro
' Macro recorded 7/8/2004 by Doug Glancy
'
Selection.Borders(xlDiagonalDown).LineStyle = xlNone
Selection.Borders(xlDiagonalUp).LineStyle = xlNone
Selection.Borders(xlEdgeLeft).LineStyle = xlNone
With Selection.Borders(xlEdgeTop)
.LineStyle = xlContinuous
.Weight = xlThin
.ColorIndex = xlAutomatic
End With
Selection.Borders(xlEdgeBottom).LineStyle = xlNone
Selection.Borders(xlEdgeRight).LineStyle = xlNone
With Selection.Interior
.ColorIndex = 3
.Pattern = xlSolid
End With
With Selection.Font
.Name = "Arial"
.Size = 10
.Strikethrough = False
.Superscript = False
.Subscript = False
.OutlineFont = False
.Shadow = False
.Underline = xlUnderlineStyleNone
.ColorIndex = xlAutomatic
End With
With Selection.Font
.Name = "Times New Roman"
.Size = 10
.Strikethrough = False
.Superscript = False
.Subscript = False
.OutlineFont = False
.Shadow = False
.Underline = xlUnderlineStyleNone
.ColorIndex = xlAutomatic
End With
With Selection.Font
.Name = "Times New Roman"
.Size = 20
.Strikethrough = False
.Superscript = False
.Subscript = False
.OutlineFont = False
.Shadow = False
.Underline = xlUnderlineStyleNone
.ColorIndex = xlAutomatic
End With
End Sub
There's a lot there that you don't need, but it's a good start.
hth,
Doug Glancy