Copying Conditional Formatting ONLY

  • Thread starter Thread starter hmm
  • Start date Start date
H

hmm

How do you paste the Conditional Formatting properties of one cell into
another without also transferring other properties (number format, font,
etc.). Is this possible?

Thanks
 
hmm said:
How do you paste the Conditional Formatting properties of one cell into
another without also transferring other properties (number format, font,
etc.). Is this possible?

Thanks

Assuming that the cell (or range) to which you want to apply the conditional
format isn't already conditionally formatted, select the cell (or range) to
which you want to apply the conditional format together with the cell that
already is conditionally formatted. (For example, if you want to copy
conditional formatting from A1 to A2:A10, click on A1 and select down to
A10. Or, if you want to copy from A1 to other specific cells, click on A1,
then hold down CTRL whilst clicking on each of these other cells in turn.)
Then use
Format > Conditional formatting
The dialog box will pop up with the conditional formatting already in it, so
all you need to do is click "OK".
 
Recorded macro that can be further cleaned up.

Sub Macro5()
Range("F12,E5,F5,F8").Select
Range("F8").Activate
Selection.FormatConditions.Delete
Selection.FormatConditions.Add Type:=xlCellValue, Operator:=xlEqual, _
Formula1:="3"
With Selection.FormatConditions(1).Font
.Bold = True
.Italic = False
End With
With Selection.FormatConditions(1).Borders(xlLeft)
.LineStyle = xlContinuous
.Weight = xlThin
.ColorIndex = xlAutomatic
End With
With Selection.FormatConditions(1).Borders(xlRight)
.LineStyle = xlContinuous
.Weight = xlThin
.ColorIndex = xlAutomatic
End With
With Selection.FormatConditions(1).Borders(xlTop)
.LineStyle = xlContinuous
.Weight = xlThin
.ColorIndex = xlAutomatic
End With
With Selection.FormatConditions(1).Borders(xlBottom)
.LineStyle = xlContinuous
.Weight = xlThin
.ColorIndex = xlAutomatic
End With
Selection.FormatConditions(1).Interior.ColorIndex = 4
End Sub
 
Back
Top