ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Syntax (https://www.excelbanter.com/excel-programming/391855-syntax.html)

[email protected]

Syntax
 
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


Mike H

Syntax
 
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


" wrote:

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



[email protected]

Syntax
 
On Jun 22, 9:16 am, Mike H wrote:
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



" wrote:
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- Hide quoted text -


- 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.Colo rIndex = 10

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

Thanks,

Jorge



All times are GMT +1. The time now is 06:26 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com