Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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 |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Conditional formatting--different formatting depending on cell con | Excel Discussion (Misc queries) | |||
Formatting cells in a column with conditional formatting? | Excel Discussion (Misc queries) | |||
Protect Cell Formatting including Conditional Formatting | Excel Discussion (Misc queries) | |||
conditional Formatting based on cell formatting | Excel Worksheet Functions | |||
Conditional Formatting that will display conditional data | Excel Worksheet Functions |