hardcoding conditional formating

mhobbs

New Member
Joined
Dec 10, 2010
Messages
21
Hi,<?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" /><o:p></o:p>
<o:p></o:p>
Can I hardcode conditional formatting? I need to copy cell colors to a table the same size with data that does not meet conditional rule.<o:p></o:p>
<o:p></o:p>
Thanks,<o:p></o:p>
<o:p></o:p>
Marland<o:p></o:p>
 

Excel Facts

How can you automate Excel?
Press Alt+F11 from Windows Excel to open the Visual Basic for Applications (VBA) editor.
Unfortunately not... The only thing you can copy to a new cell would be the "logic" that drives the conditional formatting, not the formatting itself.
 
Upvote 0
Unfortunately not... The only thing you can copy to a new cell would be the "logic" that drives the conditional formatting, not the formatting itself.

There is a way to copy the actual conditional formatting (hard code the format) if it's formula driven but you'll need to work off a temporary table first. For my example the conditional format I have is =if(A1=0,1,0); if that is met, the cell shaded green.

Steps to hard-code the conditional formatting:
  • Copy the conditional formatting formula into a temporary table (same size, etc.)
  • Change the formatting formula to be =if(A1=0,"A",1)
  • Select the temporary table
  • Select only cells that have text (this will select only the cells with A, aka cells that meet the formula criteria). See below if you have questions on how to do this.

  • Change the color of the cells
  • Voila--hard coded conditional formats that can be paste-special'ed onto the original table

To select only cells that have text do the following:
  • Select the table
  • hit F5 or Go To
  • hit Special
  • Select the Formula radio button
  • Uncheck each option until only the Text box is checked
  • hit okay
  • Excel will select only text values from the formula

This was tested in Excel 2007.
 
Upvote 0

Forum statistics

Threads
1,223,750
Messages
6,174,291
Members
452,554
Latest member
Louis1225

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top