No borders/gridlines around some cells

C

Charlie Rowe

What is the best way to not show any borders or gridlines around some cells
(not the whole sheet)?

For example, when I change the Layout of a Column field in a Pivot Table to
"Show Items in Outline Form," much of the Pivot Table has no black borders
and no grey gridlines around the cells.

When I use VBA to inspect those cells, I see a Borders.Linestyle = 1, and a
Borders.ColorIndex = xlColorIndexNone (-4142). So, the border seems to be a
line with no color, which must cover up the default gridlines.

But I cannot use VBA to set the borders that way. When I set the ColorIndex
to xlColorIndexNone, Excel automatically changes the Linestyle to -4142. So,
rather than getting a line with no color, I get no line (with no color).

Charlie Rowe
 
B

Bob Bridges

I never fool with this, but can you set the ColorIndex to xlColorIndexNone
and then change the Borders.Linestyle back to 1?
 
C

Charlie Rowe

No, when I set the Color to None, Excel automatically changes the LineStyle
to None. When I then change the LineStyle to 1, Excel automatically changes
the Color to Automatic (-4105). I cannot get both the LineStyle and the
Color set to None; but the Pivottable can do it.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top