Ark68
Well-known Member
- Joined
- Mar 23, 2004
- Messages
- 4,616
- Office Version
- 365
- 2016
- Platform
- Windows
I am using this code to format the borders of a range of cell. I'm notgetting any errors, but I'm not entirely getting the desired results ...
This is the result
Look specifically at range G12:L12. The top border should be solid xlThin but the top border of L12 is hairline; and the bottom border (of the G12:L12 range), or the interior horizontal borders of pda_range (xlInsideHorizontal) should be xlHairline - but exhibits xlThinG12:K12.
Thoughts?
EDIT: I guess xl2bb doesn't reflect border formats. Here's an image to refer to.
VBA Code:
Set pda_rng = Worksheets(sht).Range("A12:Q33")
With pda_rng(xlEdgeLeft).Borders
.LineStyle = xlContinuous
.ColorIndex = xlAutomatic
.Weight = xlThin
End With
With pda_rng(xlEdgeTop).Borders
.LineStyle = xlContinuous
.ColorIndex = xlAutomatic
.Weight = xlThin
End With
With pda_rng(xlEdgeBottom).Borders
.LineStyle = xlContinuous
.ColorIndex = xlAutomatic
.Weight = xlThin
End With
With pda_rng(xlEdgeRight).Borders
.LineStyle = xlContinuous
.ColorIndex = xlAutomatic
.Weight = xlThin
End With
With pda_rng(xlInsideVertical).Borders
.LineStyle = xlContinuous
.ColorIndex = xlAutomatic
.Weight = xlThin
End With
With pda_rng(xlInsideHorizontal).Borders
.LineStyle = xlContinuous
.ColorIndex = xlAutomatic
.Weight = xlHairline
End With
This is the result
WS 29-Jun-21.xlsm | |||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
A | B | C | D | E | F | G | H | I | J | K | L | M | N | O | P | Q | |||
10 | Record ID | Dispatch | Rental | Location | Activity | Groom | Prepare | Signature | Lights On | Lights Off | 1 | 2 | 3 | 4 | Close | ||||
11 | |||||||||||||||||||
12 | |||||||||||||||||||
13 | |||||||||||||||||||
14 | |||||||||||||||||||
15 | |||||||||||||||||||
16 | |||||||||||||||||||
17 | |||||||||||||||||||
18 | |||||||||||||||||||
19 | |||||||||||||||||||
20 | |||||||||||||||||||
21 | |||||||||||||||||||
22 | |||||||||||||||||||
23 | |||||||||||||||||||
24 | |||||||||||||||||||
25 | |||||||||||||||||||
26 | |||||||||||||||||||
27 | |||||||||||||||||||
28 | |||||||||||||||||||
29 | |||||||||||||||||||
30 | |||||||||||||||||||
31 | |||||||||||||||||||
32 | |||||||||||||||||||
33 | |||||||||||||||||||
34 | |||||||||||||||||||
CRP |
Look specifically at range G12:L12. The top border should be solid xlThin but the top border of L12 is hairline; and the bottom border (of the G12:L12 range), or the interior horizontal borders of pda_range (xlInsideHorizontal) should be xlHairline - but exhibits xlThinG12:K12.
Thoughts?
EDIT: I guess xl2bb doesn't reflect border formats. Here's an image to refer to.