Reset conditional color VB

G

Guest

Hi
I used VBA to conditional color bar chart but when I run macro again it
paint on top of last coloring task.
How can I reset the function

Interior.ColorIndex= ....

to begin color my bar chart in fresh condition?
Thanks
Daniel
 
T

Trevor Shuttleworth

Daniel

maybe:

Selection.Interior.ColorIndex = xlNone

For example:

With Selection.Interior
.ColorIndex = 6 ' set the colour to yellow
.Pattern = xlSolid
End With
Selection.Interior.ColorIndex = xlNone ' reset the colour

Or, if you want to change a specific cell:

Range("A1").Interior.ColorIndex = xlNone

Regards

Trevor
 

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