PC Review


Reply
Thread Tools Rate Thread

How to copy an XL2007 conditional format from one range to another?

 
 
Josh Sale
Guest
Posts: n/a
 
      1st Mar 2007
I have a cell that has been formatted using XL2007's fancy new conditional
formats (you know data bars, color scales, icon sets, etc) and I want to
copy those conditional formats to another cell in my code. I know this can
be done using Copy and PasteSpecial but this is to blunt an instrument
(i.e., Copy and PasteSpecial will transfer more properties from the source
to the target than I want). All I want is to copy the conditional formats.

It looks like the conditional format lives in the FormatConditions
collection of the range object but I'm not sure how to copy them.

For example, Target.FormatConditions = Source.FormatConditions doesn't work.

I can loop through them:

For Each condition in Source.FormatConditions
' what do I do here? Maybe ...
Target.FormatConditions.Add condition.????
' or maybe?
Target.FormatConditions.AddIconSetCondition condition.???
Next condition

Yikes.

TIA,

josh


 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
Re: Usiing a formula to Conditional Format XL2007 T. Valko Microsoft Excel New Users 0 30th Jan 2010 04:53 PM
Copy range incld. format (e.g.conditional formatting) from closed Pman Microsoft Excel Programming 0 9th Jan 2009 02:33 AM
XL2007: Conditional format repeated 100 times??? Ed from AZ Microsoft Excel Discussion 1 14th Jul 2008 08:01 PM
Is conditional format met in XL2007? =?Utf-8?B?SGFtRmx5ZXI=?= Microsoft Excel Programming 0 20th Sep 2007 12:20 AM
Conditional Formatting (How to format a range depending on another range) Josh Rogers Microsoft Excel Discussion 2 6th Oct 2005 07:18 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 06:08 PM.