The code which i have does not work if i paste from another range
(range of 2 cells and above).But if i paste a single cell it works or
i have to type manually one cell after the other. what do i do so
that i can copy from another bigger range patste it in my range
A1:D72 to get the color effect.?
Private Sub Worksheet_Change(ByVal Target As Excel.Range)
Dim WatchRange As Range
Dim CellVal As Integer
If Target.Cells.Count > 1 Then Exit Sub
If Target = "" Or Not IsNumeric(Target) Then Exit Sub
CellVal = Target
Set WatchRange = Range("A1:D72")
If Not Intersect(Target, WatchRange) Is Nothing Then
Select Case CellVal
Case 0
Target.Interior.ColorIndex = 5
Case 1
Target.Interior.ColorIndex = 10
Case 2
Target.Interior.ColorIndex = 6
Case 3
Target.Interior.ColorIndex = 46
Case 4
Target.Interior.ColorIndex = 45
Case 5
Target.Interior.ColorIndex = 5
Case 6
Target.Interior.ColorIndex = 10
Case 7
Target.Interior.ColorIndex = 6
Case 8
Target.Interior.ColorIndex = 46
Case 9
Target.Interior.ColorIndex = 45
End Select
End If
End Sub