Hi All,
I am using some code to do conditional formattting (since I have more that three conditions and that's all condiitonal formatting will allow). The problem is that whenevr I try to paste multiple cells of data, the formatting does not work. Initially I had a problem deleting multiple cells (runtime error), which is why I have the line:
But now, I need to also be able to paste multiple rows and columns of data and still have the formatting work. Any ideas? Here is the code (BTW, I apply this formatting to several columns, but to save space, I have only included the code for 1 column here):
I am using some code to do conditional formattting (since I have more that three conditions and that's all condiitonal formatting will allow). The problem is that whenevr I try to paste multiple cells of data, the formatting does not work. Initially I had a problem deleting multiple cells (runtime error), which is why I have the line:
Code:
If Target.Count = 1 Then
But now, I need to also be able to paste multiple rows and columns of data and still have the formatting work. Any ideas? Here is the code (BTW, I apply this formatting to several columns, but to save space, I have only included the code for 1 column here):
Code:
Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Count = 1 Then
Dim icolor As Integer
If Not Intersect(Target, Range("C7:C24")) Is Nothing Then
Select Case Target
Case 0.9795 To 3
icolor = 45
Case 0.8895 To 0.9794
icolor = 4
Case 0.8495 To 0.8894
icolor = 27
Case 0.001 To 0.8494
icolor = 3
Case Else
icolor = 2
End Select
Target.Interior.ColorIndex = icolor
End If
End If
End Sub