vba gridlinecolorindex question

  • Thread starter Thread starter chick-racer
  • Start date Start date
C

chick-racer

i am having difficulty getting this to work.
basically, this part of the program is to reset the colored fonts an
interior color of the cells etc from the last run of the macro.

I'm getting an error, AND also, when this is executed, the "fake
default gridlines disappear altogether. Can someone steer me in th
right direction?

thank you.

ActiveSheet.Cells.Font.ColorIndex = xlColorIndexAutomatic
ActiveSheet.Cells.Interior.ColorIndex = xlColorIndexAutomatic

ActiveSheet.GridlineColorIndex = xlColorIndexAutomatic
'the last one is the troublesome lin
 
actually on further testing, the second line is the problem.
This was only supposed to change the cells with colored background bac
to origional default.. Instead it eliminates the grey default gridline
that excel has (which dont print)
I would like to have those visible, is there a way to erase th
interior color of the cells and not eliminate the grey gridlines
 
ActiveSheet.Cells.Font.ColorIndex = xlColorIndexAutomatic
ActiveSheet.Cells.Interior.ColorIndex = xlColorIndexNone

Not sure what you are trying to do with the last command, but if you have
used borders, then you need to work with the borders object.

Turn on the macro recorder and make the changes you want to get the code.
 
Sure, use the correct constant which is xlNone or xlColorIndexNone

This is spelled out pretty clearly in the help for the colorindex property:

For interior:
Set this property to xlColorIndexNone to specify that you don't want an
interior fill.
 
Back
Top