I think because xlEdgeLeft, xlEdgeTop, etc. are independent properties and
borders of e.g. C5 are xlInsideVertical and xlInsideHorizontal relative to
Range("A1:G19").
You should use
With Range("A1:G19")
.Borders(xlEdgeLeft).LineStyle = xlNone
.Borders(xlEdgeTop).LineStyle = xlNone
.Borders(xlEdgeBottom).LineStyle = xlNone
.Borders(xlEdgeRight).LineStyle = xlNone
.Borders(xlInsideVertical).LineStyle = xlNone
.Borders(xlInsideHorizontal).LineStyle = xlNone
End With
if you want to remove all borders.
Regards,
Stefi
„Gary''s Student” ezt *rta:
> In a worksheet, I have borders around cells C5 and E8 and F4 and each cell in
> D15:G19.
>
> When I run:
>
> Sub next_tryx()
> Range("A1:G19").Borders(xlEdgeBottom).LineStyle = xlNone
> End Sub
>
> The only borders that get cleared are the ones on the last row (D19:G19).
>
> Why not the others?
> --
> Gary''s Student - gsnu200773
|