Hi All,
I have a spreadsheet with a long list of informaton which has been formatted using conditional formatting. My problem is that a new CF rule is split up every time I add a row. I have written the following macro to re-set the conditional formating, so that my spreadsheet works in the correct way, but when I go to see all of the CF rules for the sheets, they are still there. How do I manage the acual CF rules using VBA?
I appreciate any help you can give me.
I have a spreadsheet with a long list of informaton which has been formatted using conditional formatting. My problem is that a new CF rule is split up every time I add a row. I have written the following macro to re-set the conditional formating, so that my spreadsheet works in the correct way, but when I go to see all of the CF rules for the sheets, they are still there. How do I manage the acual CF rules using VBA?
Code:
Public Function LastRow() As Long
Application.Volatile
ActiveSheet.AutoFilterMode = False
LastRow = ActiveSheet.Cells.Find("*", SearchOrder:=xlByRows, SearchDirection:=xlPrevious).Row
End Function
Private Sub Worksheet_Change(ByVal Target As Range)
If Sheet1.Range("D1").Value <> Sheet1.Range("E1").Value Then
MsgBox "Congratulations"
Sheet1.Range("E1").Value = Sheet1.Range("D1").Value
Range("A2:B12").FormatConditions.Delete
Range("A1:B1").Copy
Range("A2:B12").PasteSpecial
End If
End Sub
I appreciate any help you can give me.
Last edited by a moderator: