Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
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 |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
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 |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
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 |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
A bit of Syntax help please... | Excel Programming | |||
Need help with If/Then Syntax | Excel Programming | |||
VBA syntax | Excel Programming | |||
VBA syntax | Excel Discussion (Misc queries) | |||
If then syntax | Excel Worksheet Functions |