Thank you, Brian, your reply was very helpful. Please see our inline
comments below:
Brian Withun said:
It doesn't appear that you are granted very granular control over the
line thickness...
***********************************
Amen! The control is extremely limited. Other competing programs offer
much greater control over thickness. Most of them allow the user to set the
thickness in every possible fractional variation of points, inches,
centimeters, dots, etc. This is a disappointment since the default
worksheets print out like coarse, bold tables and lack the fine point sizes
and thin lines of finer professional documents printed on the same printer.
***********************************
From the Help:
/*
WEIGHT PROPERTY
Returns or sets the weight of the border. Can be one of the following
XlBorderWeight constants: xlHairline, xlThin, xlMedium, or xlThick.
Read/write Long.
*/
You can only use xlHairline, xlThin, xlMedium, or xlThick for the
thickness. You may try some VB code to assure yourself that you're
using the thinnest possible border; xlHairline
***********************************
Pretty limited selection, we're not too impressed.
***********************************
I haven't found out what xlHairline is supposed to result in, but
"hairline" typically refers to a line that is minimally thick,
dependent upon the display. Your screen will display a "hairline" as
one pixel thick. Your 600dpi printer ought to draw a "hairline" as
1/600th of an inch thick. I can't promise that Excel will do that,
though. I haven't found a definition of xlHairline for Excel, except
that is has a value of 1, whatever that means.
***********************************
One (1) may represent one single unit of whatever unit of measure the
printer is defaulting to for the print job? Thus resulting in the finest
line the printer can print, as you mentioned above.
***********************************
Sub justdoit()
With ActiveCell.Borders
.LineStyle = xlContinuous
.Color = RGB(255, 0, 0)
.Weight = xlHairline
End With
End Sub
***********************************
Thank you for the macro, it enlightened us substantially. So let us share
our observations: FIRST, the border created by this macro displays on the
screen as a red dotted line. However, it prints as a solid black hairline.
SECOND, no matter what color is selected for the resulting border, it prints
in black. Thus, if the user selects the first line style following the
'None' option in the border dialog, it will always result in a black
hairline regardless of the color selected. We are wondering if the first
line style was intended to be a solid hairline, but could only be
represented as a dotted line on the display. However, the inablility to
print in color is a mystery.
Unfortunately, this is a poor design. FIRST, hairlines are not properly
displayed. SECOND, hairlines won't print in color. THIRD, the user cannot
define the line thickness of the style chosen. In most other programs there
is a separate option for the style and then a separate option for the
thickness of the line, but Excel combines the two and the user is forced
accept whatever default combinations of style and thickness shown on the
menu. Very poor.
***********************************
Thanks Brian!