#1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 29
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,501
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 29
Default 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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
A bit of Syntax help please... ste mac Excel Programming 4 January 4th 07 09:35 PM
Need help with If/Then Syntax Shani Excel Programming 3 June 5th 06 07:11 PM
VBA syntax marcmc Excel Programming 2 November 2nd 05 04:54 PM
VBA syntax Sunantoro Excel Discussion (Misc queries) 1 September 21st 05 03:19 AM
If then syntax RL Excel Worksheet Functions 3 June 22nd 05 05:30 AM


All times are GMT +1. The time now is 07:18 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"