How do you copy cells that have Conditional Formatting and keep the Conditional Formatting?
I'm using this code, I see the formatting (albeit briefly) and then it goes away.
Sub Due_Dates()
Dim DstRng As Range
Dim R As Long
Dim RngEnd As Range
With Sheets("Calibration Log")
'Loop thru Column L
sh2LastRow = .Cells(Rows.Count, "L").End(xlUp).Row
Set sh2Range = .Range("L7:L" & sh2LastRow)
End With
' Find the last cell in column "A" starting at cell A7
Set DstRng = Sheets("Val-Cal_Due").Range("A7")
Set RngEnd = Sheets("Val-Cal_Due").Cells(Rows.Count, "A").End(xlUp)
' Set the destination to either A7 or the last entry in column "A"
Set DstRng = IIf(RngEnd.Row < DstRng.Row, DstRng, RngEnd)
For Each sh2Cell In sh2Range
If IsNumeric(sh2Cell) Then
If sh2Cell <= "10" Then
'MsgBox sh2cell 'for testing
'sh2Cell.EntireRow.Copy Destination:=DstRng.Offset(R, 0)
sh2Cell.EntireRow.Copy
With sh5Cell
DstRng.Offset(R, 0).PasteSpecial Paste:=xlPasteValuesAndNumberFormats, Operation:= _
xlNone, SkipBlanks:=False, Transpose:=False
End With
R = R + 1
End If
End If
Next sh2Cell
Call Charts.Charts
End Sub
Bookmarks