Syntax

  • Thread starter Thread starter lovepeaceofmind
  • Start date Start date
L

lovepeaceofmind

Hi, all:

In one of my worksheets, some cells are MANUALLY filled in with color
"bright green" and some other cells will change color to "bright
green" with CONDITIONAL FORMAT of if cell value is > 0 then cell color
is "bright green".

Assume I already finish all the work in this worksheet, I just want to
make a button. Once I click the button, then all cells color will be
changed to "No Fill". The only thing I know is the syntax for the
cells filled with color manually which is

Worksheets("Sheet1").Cells.Interior.ColorIndex =xlNone

How about the cells changing color based on cell value > 0?

I appreciate your help!

Thanks,

Jorge
 
Try this:-
Before you run this think again and make sure this is what you want because
it will remove all your conditional formatting (not just the colours) and
manually coloured cells. BEWARE.

Sub surface()
ActiveSheet.UsedRange.Interior.ColorIndex = xlNone
ActiveSheet.UsedRange.FormatConditions.Delete
End Sub

Mike
 
Try this:-
Before you run this think again and make sure this is what you want because
it will remove all your conditional formatting (not just the colours) and
manually coloured cells. BEWARE.

Sub surface()
ActiveSheet.UsedRange.Interior.ColorIndex = xlNone
ActiveSheet.UsedRange.FormatConditions.Delete
End Sub

Mike










- Show quoted text -

Hi, Mike:

It is very good. Working as expected! One more question:

For the cells with manaully filled in colors, I can assign an index.
For example, Cells A1:A10, I have the following code:

Worksheets("Sheet1").Cells("A1:A10").Interior.ColorIndex = 10

Is there any way to assign an index number for the cells with
conditional formatted color?

Thanks,

Jorge
 

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

Back
Top