Excel - Copy Conditional Formatting, Remove Rules, Keep Format

淺唱寂寞╮ 提交于 2019-11-29 06:45:47

Yes it is possible :) What you need to do is change the formatting of the cells that you plan to copy by mimicking the DisplayFormat and then deleting the conditional formatting

Sub Keep_Format()
    Dim ws As Worksheet
    Dim mySel As Range, aCell As Range

    '~~> Change this to the relevant sheet
    Set ws = ThisWorkbook.Sheets("Sheet1")
    '~~> Change this to the relevant range
    Set mySel = ws.Range("A1:A10")

    For Each aCell In mySel
        With aCell
          .Font.FontStyle = .DisplayFormat.Font.FontStyle
          .Interior.Color = .DisplayFormat.Interior.Color
          .Font.Strikethrough = .DisplayFormat.Font.Strikethrough
        End With
    Next aCell

    mySel.FormatConditions.Delete

    '
    '~~> Now Do the copying
    '

    '~~> Once you are done, close the sorce worksheet without saving
End Sub

I think I've got it with the Office Clipboard: Copy range, open the Office Clipboard pane (the tiny button in the bottom right corner of the Clipboard section under the Home tab) and paste from there.

Here's a demo: http://www.bookkempt.com/2017/08/remove-conditional-formatting-but-keep.html

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!