To: ahmed
re: condtional formatting of borders
Shown below are notes, to myself, on Excel cell borders from 2006 (13 years ago).
I don't believe anything has changed.
Those with an interest, should read thru the entire note...
'---
June 12, 2006
Notes on Excel Borders and Colors...
There are 8 regular borders for a cell.
Constants 5 thru 12...
Constants 7, 8, 9, 10 are the cell edges.
(xlEdgeLeft, xlEdgeTop, xlEdgeBottom, xlEdgeRight)
Constants 5, 6, 11, 12 are interior borders that are unique to a cell.
There are 4 regular border weights (widths) for a cell.
Constants 1, 2, -4138, 4
(xlHairline, xlThin, xlMedium, xlThick)
Note: a blank cell, with no borders, has a border weight of 2.
There are 7 regular border linestyles for a cell
Constants 1, -4115, 4, 5, -4118, -4119, 13
(xlContinuous, xlDash, xlDashdot, xlDashdotdot, xlDot, xlDouble, xlSlantdashdot)
There are 4 CF borders for a cell.
Constants -4131, - 4160, - 4107, - 4152
(xlLeft, xlTop, xlBottom, xlRight)
These are equivalent to constants 7, 8, 9, 10 for regular borders.
There are 2 CF border weights (widths) for a cell.
Constants 1, 2 (xlHairline, xlThin)
There are 5 CF border linestyles for a cell.
Constants 1, -4115, 4, 5, - 4118
(xlContinuous, xlDash, xlDashdot, xlDashdotdot, xlDot)
- Shown in PRIORITY ORDER -
All CF linestyles, except xlDot, have a fixed weight of 2.
The xlDot linestyle weight is 1.
Borders between adjoining cells are a common border, with some exceptions.
Excel keeps track of the cell from which the border was applied.
(the owner cell for the border)
CF borders always override any regular borders in a cell as long as the
regular borders originated in that cell.
CF borders override adjoining cell CF borders/regular borders if the
active cell CF border is wider than the other border - or -
if the same width but has a higher priority linestyle.
If active cell CF borders are the same (width and linestyle) as the adjoining CF/regular
borders then the dominant color is visible.
The dominant color is difficult to determine.
If active cell CF borders are narrower than the adjoining borders - or -
if the same width, but have a lower priority linestyle, then the adjoining cell,
CF/regular borders are displayed.
'---
My conclusion: don't bother using CF on borders.
Some new, some older Excel programs (now free) at MediaFire...
Download from... http://www.mediafire.com/folder/lto3hbhyq0hcf/Documents