E
EagleOne
2003
VBA offers a shortcut to add borders around a range like:
Worksheets("Sheet1").Range("B1
1").BorderAround ColorIndex:=3, _
Weight:=xlThick
But to remove the border it appears that only the following works:
With Worksheets("Sheet1").Range("B1
1")
.Borders(xlDiagonalDown).LineStyle = xlNone
.Borders(xlDiagonalUp).LineStyle = xlNone
.Borders(xlEdgeLeft).LineStyle = xlNone
.Borders(xlEdgeTop).LineStyle = xlNone
.Borders(xlEdgeBottom).LineStyle = xlNone
.Borders(xlEdgeRight).LineStyle = xlNone
.Borders(xlInsideVertical).LineStyle = xlNone
.Borders(xlInsideHorizontal).LineStyle = xlNone
Endwith
The VBA documention mentions:
"To clear the border, you must set the LineStyle property to
xlLineStyleNone for all the cells in the range."
But that does not work as stated. In fact, it errors out re: Object.
Is there a shortcut BorderAround Clear or is the 8 step process above
the only way?
TIA
Dennis
VBA offers a shortcut to add borders around a range like:
Worksheets("Sheet1").Range("B1

Weight:=xlThick
But to remove the border it appears that only the following works:
With Worksheets("Sheet1").Range("B1

.Borders(xlDiagonalDown).LineStyle = xlNone
.Borders(xlDiagonalUp).LineStyle = xlNone
.Borders(xlEdgeLeft).LineStyle = xlNone
.Borders(xlEdgeTop).LineStyle = xlNone
.Borders(xlEdgeBottom).LineStyle = xlNone
.Borders(xlEdgeRight).LineStyle = xlNone
.Borders(xlInsideVertical).LineStyle = xlNone
.Borders(xlInsideHorizontal).LineStyle = xlNone
Endwith
The VBA documention mentions:
"To clear the border, you must set the LineStyle property to
xlLineStyleNone for all the cells in the range."
But that does not work as stated. In fact, it errors out re: Object.
Is there a shortcut BorderAround Clear or is the 8 step process above
the only way?
TIA
Dennis