Converting Conditional Formatting to Regular Formatting

Written by Allen Wyatt (last updated January 4, 2020)
This tip applies to Excel 2007, 2010, 2013, 2016, 2019, and Excel in Microsoft 365


9

Parton wonders if there is a way to convert conditional formatting into absolute formatting. He would like to be able to 'fix' the formatting in a worksheet in a way similar to how Paste Values can be used to 'fix' the values of cells.

There is no way to do this in Excel. (It would be especially great if you could do it using a Paste Special option, as Parton notes.) You can, however, use some macros to do the trick. The macros are not trivial, however, as VBA doesn't give you a whole lot of help in dealing with conditional formatting. For a good idea of what is involved, you may want to refer to this page on Chip Pearson's website:

http://www.cpearson.com/excel/CFColors.htm

There is another thing you can try, as well, that involves saving your workbook in a different format. Try these general steps:

  1. Load the workbook that contains your conditional formatting.
  2. Save the workbook as an HTML file. (Press F12, specify the HTML format, and give the workbook a different name.)
  3. Restart Excel.
  4. Load into Excel the HTML file you saved in step 2.
  5. Save the workbook as an Excel workbook. (Press F12, specify an Excel workbook format, and give the workbook a different name.)

In the process of saving the Excel workbook in HTML format, the program "strips" all the conditional formatting and makes it explicit (absolute). You should be aware, however, that this process also does the same with your formulas, saving everything as a value, instead. Even so, this may work for your needs if the tradeoff is acceptable.

ExcelTips is your source for cost-effective Microsoft Excel training. This tip (13721) applies to Microsoft Excel 2007, 2010, 2013, 2016, 2019, and Excel in Microsoft 365.

Author Bio

Allen Wyatt

With more than 50 non-fiction books and numerous magazine articles to his credit, Allen Wyatt is an internationally recognized author. He is president of Sharon Parq Associates, a computer and publishing services company. ...

MORE FROM ALLEN

Columns in a Text Box

Want to divide a text box into columns? Word doesn't allow you to do this, but there are ways to work around the limitation.

Discover More

Switching Headers in a Frozen Row

Excel allows you to "freeze" rows in your worksheet. What if you want the rows that are frozen to change as you scroll ...

Discover More

Filling a Range of Cells with Values

When writing a macro, you may want to fill a range of cells with different values. The easiest way to do this is to use ...

Discover More

Excel Smarts for Beginners! Featuring the friendly and trusted For Dummies style, this popular guide shows beginners how to get up and running with Excel while also helping more experienced users get comfortable with the newest features. Check out Excel 2013 For Dummies today!

More ExcelTips (ribbon)

Changing Font Face and Size Conditionally

Conditional formatting does not allow you to change the typeface and font size used in a cell. You can write your own ...

Discover More

Conditionally Formatting for Multiple Date Comparisons

When you compare dates in a conditional formatting rule, you need to be careful how you put your comparisons together. Do ...

Discover More

Detecting Errors in Conditional Formatting Formulas

If an error exists in a formula tucked inside a conditional format, you may never know it is there. There are ways to ...

Discover More
Subscribe

FREE SERVICE: Get tips like this every week in ExcelTips, a free productivity newsletter. Enter your address and click "Subscribe."

View most recent newsletter.

Comments

If you would like to add an image to your comment (not an avatar, but an image to help in making the point of your comment), include the characters [{fig}] (all 7 characters, in the sequence shown) in your comment text. You’ll be prompted to upload your image when you submit the comment. Maximum image size is 6Mpixels. Images larger than 600px wide or 1000px tall will be reduced. Up to three images may be included in a comment. All images are subject to review. Commenting privileges may be curtailed if inappropriate images are posted.

What is one less than 9?

2023-07-11 08:28:02

Mike J

The tip mentions that saving to html has the disadvantage of also converting formulas to values.

However if you clear the conditional formatting from the original file, then copy the range (or whole sheet, if necessary) from the .html file and paste back just the formatting over the original .xlsx range, the formulas can be retained.

Incidentally, saving to a .mht (single file web page) works too, and eliminates the creation of a redundant directory.

Still not as slick as the ASAP Utilities route, but it could possibly be made into a vba sub(), even cleaning up after itself.


2023-07-10 17:28:05

Xandria

OMG, you just saved me a massive amount of work. Great solution. Thank you!


2021-03-10 11:10:09

Patrick

This was amazingly easy! Thank you so much, you saved me tons of time and what little hair I have left with this solution.


2020-07-02 05:33:32

Yazan

The way I do it is a bit simpler .
I copy the range and paste it into powerpoint maintaining source formatting. Then I copy the range again from powerpoint to Excel.
This works just fine with minor drawbacks; sometimes font size will change.
It's a workaround, but ti works :)


2020-01-24 04:31:19

Gerhard Seljehammer

Hi,

ASAP Utilities, which I highly recommend, has solved that (and many other challenges in Excel) with: "Range » Replace conditional formatting with static formatting in selection".


2020-01-06 17:20:49

Tomek

To carry the second solution a step further, I think it would be possible to do the HTML trick creating a new version of the original file (with a new name), then copy and paste special - formulas from the original worksheet to the new one. You could also paste special - column widths and/or formulas and number formats, and possibly comments. It is a bit of extra work, but would overcome the trade-off mentioned in the tip.

If you need to do this often you could record a macro that does all the work, then modify it to use with different file names (if you are proficient with macros).


2020-01-05 02:33:30

Peter McNab

I do this on a regular basis when extracting sheets from a spreadsheet containing conditional formatting. In my case, I am only interested in the font colour and background colour. Once the extracted sheets are manipulated and the primary workbook is closed, the conditions no longer apply. So before that I run a macro that checks each cell, similar to the following, using the DisplayFormat property. This does take a little while even for a small spreadsheet (my real case does other stuff in the loop), but it may be quicker than the html procedure.
' determine a range of interest
Set rSelect = Range("a1")
Set rSelect = Range(rSelect, rSelect.SpecialCells(xlLastCell))
' check all cells in range
For Each cc In rSelect
With cc
If .FormatConditions.Count > 0 Then
' use conditionally formatted foreground and background colour
.Interior.Color = .DisplayFormat.Interior.Color
.Font.Color = .DisplayFormat.Font.Color
End If
End With
Next cc


2020-01-04 22:15:26

Max Zimmerman

Would it not be simpler to select the page/copy open a new tab and paste formulas? Delete the old tab if no longer needed.


2020-01-04 12:06:44

Jim

For those who might be looking for a "i don't need to know how it works, just need to get it done" solution - ASAP Utilities <https://www.asap-utilities.com/> has a tool that will do this.


This Site

Got a version of Excel that uses the ribbon interface (Excel 2007 or later)? This site is for you! If you use an earlier version of Excel, visit our ExcelTips site focusing on the menu interface.

Newest Tips
Subscribe

FREE SERVICE: Get tips like this every week in ExcelTips, a free productivity newsletter. Enter your address and click "Subscribe."

(Your e-mail address is not shared with anyone, ever.)

View the most recent newsletter.