Microsoft Office Tutorials and References
In Depth Information
19.4.3.2 ColorIndex property
will produce a 25% grayscale. (The larger the numbers, the closer to white.) Unfortunately, Excel
rounds all grayscale settings to one of the following:
0% (white)
25%
40%
50%
80%
100% (black)
You can see this by running the following code:
Dim r As Integer
For r = 1 To 25
Cells(r, 1).Interior.Color = _
RGB(255 - 10 * r, 255 - 10 * r, 255 - 10 * r)
Cells(r, 2).Value = 255 - 10 * r
Next
If you want to use grayscales often, consider adding the following constant declarations to a code
module. (The numbers on the right are RGB values.)
Public Const Gray25 = 12632256
Public Const Gray40 = 9868950
Public Const Gray50 = 8421504
Public Const Gray80 = 3355443
19.4.3.2 ColorIndex property
This property sets the color by using an index into a color palette. There is no way to do justice to
this in a black and white book, so I suggest you take a look at this property in Excel's help
documentation, where there is a color picture. However, you can set this property to one of the
following XlColorIndex constants as well:
Enum XlColorIndex
xlColorIndexNone = -4142 ' no interior fill
xlColorIndexAutomatic = -4105 ' automatic fill
End Enum
19.4.3.3 LineStyle property
The LineStyle property returns or sets the line style for the border. It can be one of the following
XlLineStyle constants:
Enum XlLineStyle
xlLineStyleNone = -4142
xlDouble = -4119
xlDot = -4118
xlDash = -4115
xlContinuous = 1
xlDashDot = 4
xlDashDotDot = 5
xlSlantDashDot = 13
End Enum
These values speak pretty much for themselves.
Search JabSto ::




Custom Search