Microsoft Office Tutorials and References
In Depth Information
The array of patterns available to you, represented by the Excel constants in the Pattern prop­
erty’s description in the preceding table, are available for viewing by clicking Format, Cells,
clicking the Patterns tab, and clicking the Pattern down arrow.
One important thing to know about the Color and ColorIndex properties is that they affect a
different aspect of the cell’s interior than do the PatternColor and PatternColorIndex
properties. The default color for either the PatternColor or PatternColorIndex properties is black
(represented in the PatternColorIndex property as the index number 1), but you can change
the color of the pattern.
The following procedure changes the fill color of the active cell to blue, adds a pattern of thin,
black, horizontal lines, and then changes the color of the fill pattern to white:
Sub ChangePattern()
With ActiveCell
.Interior.ColorIndex = 5
MsgBox (“OK to add the horizontal pattern?”)
.Interior.Pattern = xlPatternLightHorizontal
MsgBox (“OK to change the pattern’s color?”)
.Interior.PatternColorIndex = 2
End With
End Sub
Search JabSto ::




Custom Search