0

How can I copy just the format of a cell when the format is derived by a "conditional formatting" but without copy the condition too?

1 Answer 1

0

I found only this way:

using vba, run this sub:

Sub Keep_Format()    
    Dim xRg As Range
    Dim xTxt As String
    Dim xCell As Range
    On Error Resume Next
    If ActiveWindow.RangeSelection.Count > 1 Then
      xTxt = ActiveWindow.RangeSelection.AddressLocal
    Else
      xTxt = ActiveSheet.UsedRange.AddressLocal
    End If
    Set xRg = Application.InputBox("Select range:", "tools for Excel", xTxt, , , , , 8)
    If xRg Is Nothing Then Exit Sub
    For Each xCell In xRg
        With xCell
          .Font.FontStyle = .DisplayFormat.Font.FontStyle
          .Interior.Color = .DisplayFormat.Interior.Color
          .Font.Strikethrough = .DisplayFormat.Font.Strikethrough
        End With
    Next
    xRg.FormatConditions.Delete
End Sub

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .