Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 103
Default Conditional Formatting

I have a large spreadsheet that is a calender of resources and their
availability. The weekends are all greyed out and I have all the weekdays
formatted using the same conditional formatting.

Is there any way to create a "style" so that I can easily change the
formatting that is applied under each condition.

(i.e. I don't want to change the conditions, I want to change the
formatting)


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,163
Default Conditional Formatting

I can think of 2 ways to go about this; one easier to code and the other is
the more "elegant" solution:
1) Write a sub that steps through the cells in your range and modifies the
FormatCondition; basic outline as follows (this assumes the initial format
condition is already set in all the cells in the range):
Sub MyFormat(FormatRange as Range, InteriorColor as Long, ...)
' You can add as many parameters as you would like in order to define your
format
Dim FormatCell as Range
For Each FormatCell in FormatRange
With FormatCell.FormatConditions(1)
.Interior.Color = InteriorColor
... ' can adjust other properties here using similar statements and
parameter values
Next FormatCell
End Sub

A better (more flexible and 'stronger') way to do this would be to create a
custom class that would mimic a "style" by taking a FormatCondition object
and adding your own properties and methods to allow you to treat it just like
a format style. But the coding for that is too complex for me to get into
here and unless you want to pursue this I think the above method would work
best for your current issue.

HTH!
--
- K Dales


"Andibevan" wrote:

I have a large spreadsheet that is a calender of resources and their
availability. The weekends are all greyed out and I have all the weekdays
formatted using the same conditional formatting.

Is there any way to create a "style" so that I can easily change the
formatting that is applied under each condition.

(i.e. I don't want to change the conditions, I want to change the
formatting)



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 103
Default Conditional Formatting

Thanks for the advice - I think the simpler option is the only one worth
persuing due to time.

Thanks

"K Dales" wrote in message
...
I can think of 2 ways to go about this; one easier to code and the other

is
the more "elegant" solution:
1) Write a sub that steps through the cells in your range and modifies the
FormatCondition; basic outline as follows (this assumes the initial format
condition is already set in all the cells in the range):
Sub MyFormat(FormatRange as Range, InteriorColor as Long, ...)
' You can add as many parameters as you would like in order to define your
format
Dim FormatCell as Range
For Each FormatCell in FormatRange
With FormatCell.FormatConditions(1)
.Interior.Color = InteriorColor
... ' can adjust other properties here using similar statements and
parameter values
Next FormatCell
End Sub

A better (more flexible and 'stronger') way to do this would be to create

a
custom class that would mimic a "style" by taking a FormatCondition object
and adding your own properties and methods to allow you to treat it just

like
a format style. But the coding for that is too complex for me to get into
here and unless you want to pursue this I think the above method would

work
best for your current issue.

HTH!
--
- K Dales


"Andibevan" wrote:

I have a large spreadsheet that is a calender of resources and their
availability. The weekends are all greyed out and I have all the

weekdays
formatted using the same conditional formatting.

Is there any way to create a "style" so that I can easily change the
formatting that is applied under each condition.

(i.e. I don't want to change the conditions, I want to change the
formatting)





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
Conditional formatting--different formatting depending on cell con Tammy S. Excel Discussion (Misc queries) 3 March 30th 09 08:11 PM
Formatting cells in a column with conditional formatting? shamor Excel Discussion (Misc queries) 8 May 19th 08 10:11 PM
Protect Cell Formatting including Conditional Formatting Mick Jennings Excel Discussion (Misc queries) 5 November 13th 07 05:32 PM
conditional Formatting based on cell formatting Totom Excel Worksheet Functions 3 January 20th 07 02:02 PM
Conditional Formatting that will display conditional data BrainFart Excel Worksheet Functions 1 September 13th 05 05:45 PM


All times are GMT +1. The time now is 12:27 PM.

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

About Us

"It's about Microsoft Excel"